Prefer GCC's constructor, even in Windows

This commit is contained in:
Chris Robinson
2010-11-28 14:27:07 -08:00
parent 0e748d98d5
commit 490d1c6a8e
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -377,6 +377,10 @@ static FILE *LogFile;
///////////////////////////////////////////////////////
// ALC Related helper functions
#ifdef HAVE_GCC_DESTRUCTOR
static void alc_init(void) __attribute__((constructor));
static void alc_deinit(void) __attribute__((destructor));
#else
#ifdef _WIN32
static void alc_init(void);
static void alc_deinit(void);
@@ -399,10 +403,6 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
}
return TRUE;
}
#else
#ifdef HAVE_GCC_DESTRUCTOR
static void alc_init(void) __attribute__((constructor));
static void alc_deinit(void) __attribute__((destructor));
#endif
#endif
+3 -3
View File
@@ -119,11 +119,11 @@ ELSE()
"Flags used by the compiler during debug builds."
FORCE)
CHECK_C_SOURCE_COMPILES("int foo() __attribute__((destructor));
int main() {return 0;}" HAVE_GCC_DESTRUCTOR)
# Set visibility options if available
IF(NOT WIN32)
CHECK_C_SOURCE_COMPILES("int foo() __attribute__((destructor));
int main() {return 0;}" HAVE_GCC_DESTRUCTOR)
CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY_SWITCH)
IF(HAVE_VISIBILITY_SWITCH)
CHECK_C_SOURCE_COMPILES("int foo() __attribute__((visibility(\"default\")));