File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ include(CheckCSourceCompiles)
2
2
include (TestBigEndian)
3
3
include (CheckIncludeFile)
4
4
include (CheckSymbolExists)
5
+ include (CheckStructHasMember)
5
6
6
7
check_include_file(cpuid.h HAVE_CPUID_H)
7
8
@@ -40,6 +41,27 @@ set(CMAKE_REQUIRED_LIBRARIES)
40
41
set (CMAKE_REQUIRED_INCLUDES)
41
42
endif ()
42
43
44
+ #
45
+ # Check for pthread struct members
46
+ #
47
+ set (CMAKE_REQUIRED_FLAGS ${THREADS_PREFER_PTHREAD_FLAG} )
48
+ set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} )
49
+
50
+ check_struct_has_member("struct __pthread_rwlock_arch_t"
51
+ "__readers"
52
+ "pthread.h"
53
+ HAVE_THREAD_RWLOCK_ARCH_T_READERS
54
+ LANGUAGE C)
55
+
56
+ check_struct_has_member("struct __pthread_rwlock_arch_t"
57
+ "__nr_readers"
58
+ "pthread.h"
59
+ HAVE_THREAD_RWLOCK_ARCH_T_NR_READERS
60
+ LANGUAGE C)
61
+
62
+ unset (CMAKE_REQUIRED_FLAGS)
63
+ unset (CMAKE_REQUIRED_LIBRARIES)
64
+
43
65
set (CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} )
44
66
45
67
check_c_source_compiles("#include <stdio.h>
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ static const char *dt_supported_extensions[] __attribute__((unused)) = {"@DT_SUP
71
71
72
72
#cmakedefine HAVE_OMP_FIRSTPRIVATE_WITH_CONST 1
73
73
74
+ #cmakedefine HAVE_THREAD_RWLOCK_ARCH_T_READERS 1
75
+
76
+ #cmakedefine HAVE_THREAD_RWLOCK_ARCH_T_NR_READERS 1
77
+
74
78
/******************************************************************************
75
79
* OpenCL target settings
76
80
*****************************************************************************/
You can’t perform that action at this time.
0 commit comments