summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-01-21 02:33:45 -0800
committerChris Robinson <[email protected]>2016-01-21 02:33:45 -0800
commitbb0ac26ce1bc8966d87e5db2d9a9675bd939b6af (patch)
tree1c4dfd7b8ca38867942687294f8b3f5182f05135 /CMakeLists.txt
parent9c05a16c9a394dea90fcefc29eb2ef2be06dc4b5 (diff)
Explicit check if pthread_setname_np accepts only one parameter
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e503df92..9326f270 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -561,12 +561,33 @@ IF(NOT HAVE_WINDOWS_H)
CHECK_SYMBOL_EXISTS(pthread_setname_np "pthread.h;pthread_np.h" HAVE_PTHREAD_SETNAME_NP)
IF(NOT HAVE_PTHREAD_SETNAME_NP)
CHECK_SYMBOL_EXISTS(pthread_set_name_np "pthread.h;pthread_np.h" HAVE_PTHREAD_SET_NAME_NP)
+ ELSE()
+ CHECK_C_SOURCE_COMPILES("
+#include <pthread.h>
+#include <pthread_np.h>
+int main()
+{
+ pthread_setname_np(\"testname\");
+ return 0;
+}"
+ PTHREAD_SETNAME_NP_ONE_PARAM
+ )
ENDIF()
CHECK_SYMBOL_EXISTS(pthread_mutexattr_setkind_np "pthread.h;pthread_np.h" HAVE_PTHREAD_MUTEXATTR_SETKIND_NP)
ELSE()
CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP)
IF(NOT HAVE_PTHREAD_SETNAME_NP)
CHECK_SYMBOL_EXISTS(pthread_set_name_np pthread.h HAVE_PTHREAD_SET_NAME_NP)
+ ELSE()
+ CHECK_C_SOURCE_COMPILES("
+#include <pthread.h>
+int main()
+{
+ pthread_setname_np(\"testname\");
+ return 0;
+}"
+ PTHREAD_SETNAME_NP_ONE_PARAM
+ )
ENDIF()
CHECK_SYMBOL_EXISTS(pthread_mutexattr_setkind_np pthread.h HAVE_PTHREAD_MUTEXATTR_SETKIND_NP)
ENDIF()