check_function_exists(seteuid HAVE_SETEUID)
check_function_exists(setreuid HAVE_SETREUID)
check_function_exists(setresuid HAVE_SETRESUID)
+check_function_exists(getresuid HAVE_GETRESUID)
+check_function_exists(getresgid HAVE_GETRESGID)
check_function_exists(setegid HAVE_SETEGID)
check_function_exists(setregid HAVE_SETREGID)
set(CMAKE_REQUIRED_DEFINITIONS)
endif (LINUX)
+check_c_source_compiles("
+#include <stdbool.h>
+int main(void) {
+ bool x;
+ bool *p_x = &x;
+ __atomic_load(p_x, &x, __ATOMIC_RELAXED);
+ return 0;
+}" HAVE_GCC_ATOMIC_BUILTINS)
+
check_c_source_compiles("
__thread int tls;
return 0;
}" HAVE_GCC_THREAD_LOCAL_STORAGE)
+check_c_source_compiles("
+void test_constructor_attribute(void) __attribute__ ((constructor));
+
+void test_constructor_attribute(void)
+{
+ return;
+}
+
+int main(void) {
+ return 0;
+}" HAVE_CONSTRUCTOR_ATTRIBUTE)
+
check_c_source_compiles("
void test_destructor_attribute(void) __attribute__ ((destructor));
return 0;
}" HAVE_DESTRUCTOR_ATTRIBUTE)
+# If this produces a warning treat it as error!
+set(CMAKE_REQUIRED_FLAGS "-Werror")
+check_c_source_compiles("
+void test_address_sanitizer_attribute(void) __attribute__((no_sanitize_address));
+
+void test_address_sanitizer_attribute(void)
+{
+ return;
+}
+
+int main(void) {
+ return 0;
+}" HAVE_ADDRESS_SANITIZER_ATTRIBUTE)
+set(CMAKE_REQUIRED_FLAGS)
+
check_c_source_compiles("
void log_fn(const char *format, ...) __attribute__ ((format (printf, 1, 2)));