diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 0c4beb72..4f4bcee2 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -272,6 +272,30 @@ int main(void) { # errors set(CMAKE_REQUIRED_FLAGS "-Werror") +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)); + +void test_destructor_attribute(void) +{ + return; +} + +int main(void) { + return 0; +}" HAVE_DESTRUCTOR_ATTRIBUTE) + check_c_source_compiles(" #define FALL_THROUGH __attribute__((fallthrough)) diff --git a/config.h.cmake b/config.h.cmake index 421f527d..edf5be21 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -193,6 +193,9 @@ #cmakedefine HAVE_FALLTHROUGH_ATTRIBUTE 1 +#cmakedefine HAVE_CONSTRUCTOR_ATTRIBUTE 1 +#cmakedefine HAVE_DESTRUCTOR_ATTRIBUTE 1 + #cmakedefine HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1 #cmakedefine HAVE_GCC_NARG_MACRO 1