Prefer GNU library initialization mechanism over platform one
[openssl.git] / providers / fips / self_test.c
index a41f49b8871de6ca497719aebe1a19cec0f45781..07534e89750c7a40474696a97d8daf3c5d72b509 100644 (file)
@@ -103,6 +103,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
     }
     return TRUE;
 }
+
+#elif defined(__GNUC__)
+# undef DEP_INIT_ATTRIBUTE
+# undef DEP_FINI_ATTRIBUTE
+# define DEP_INIT_ATTRIBUTE static __attribute__((constructor))
+# define DEP_FINI_ATTRIBUTE static __attribute__((destructor))
+
 #elif defined(__sun)
 # pragma init(init)
 # pragma fini(cleanup)
@@ -125,12 +132,6 @@ void _cleanup(void)
 # pragma init "init"
 # pragma fini "cleanup"
 
-#elif defined(__GNUC__)
-# undef DEP_INIT_ATTRIBUTE
-# undef DEP_FINI_ATTRIBUTE
-# define DEP_INIT_ATTRIBUTE static __attribute__((constructor))
-# define DEP_FINI_ATTRIBUTE static __attribute__((destructor))
-
 #elif defined(__TANDEM)
 /* Method automatically called by the NonStop OS when the DLL loads */
 void __INIT__init(void) {