include(CheckPrototypeDefinition)
include(TestBigEndian)
-set(PACKAGE ${PROJECT_NAME})
-set(VERSION ${PROJECT_VERSION})
+set(SOCKET_WRAPPER_PACKAGE ${PROJECT_NAME})
+set(SOCKET_WRAPPER_VERSION ${PROJECT_VERSION})
set(BINARYDIR ${CMAKE_BINARY_DIR})
set(SOURCEDIR ${CMAKE_SOURCE_DIR})
check_function_exists(pledge HAVE_PLEDGE)
check_function_exists(_socket HAVE__SOCKET)
check_function_exists(_close HAVE__CLOSE)
+check_function_exists(__close_nocancel HAVE___CLOSE_NOCANCEL)
if (UNIX)
find_library(DLFCN_LIBRARY dl)
return 0;
}" HAVE_DESTRUCTOR_ATTRIBUTE)
+check_c_source_compiles("
+#pragma init (test_constructor)
+void test_constructor(void);
+
+void test_constructor(void)
+{
+ return;
+}
+
+int main(void) {
+ return 0;
+}" HAVE_PRAGMA_INIT)
+
+check_c_source_compiles("
+#pragma fini (test_destructor)
+void test_destructor(void);
+
+void test_destructor(void)
+{
+ return;
+}
+
+int main(void) {
+ return 0;
+}" HAVE_PRAGMA_FINI)
+
check_c_source_compiles("
#define FALL_THROUGH __attribute__((fallthrough))