DLLEntryPoint is a collective name, not what linker looks for. However,
[openssl.git] / crypto / cryptlib.c
index 79c54b920eb6aad9c7e9ba818a4e3f1642dc9651..e0380a38f4c35104fc05ace3499f30e10051eaea 100644 (file)
@@ -544,7 +544,7 @@ const char *CRYPTO_get_lock_name(int type)
 unsigned long  OPENSSL_ia32cap=0;
 unsigned long *OPENSSL_ia32cap_loc() { return &OPENSSL_ia32cap; }
 
-#if !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY)
+#if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY)
 #define OPENSSL_CPUID_SETUP
 void OPENSSL_cpuid_setup()
 { static int trigger=0;
@@ -571,13 +571,12 @@ void OPENSSL_cpuid_setup()
 void OPENSSL_cpuid_setup() {}
 #endif
 
-#ifdef _DLL
-#ifdef OPENSSL_SYS_WIN32
+#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(_DLL)
 
 /* All we really need to do is remove the 'error' state when a thread
  * detaches */
 
-BOOL WINAPI DLLEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason,
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
             LPVOID lpvReserved)
        {
        switch(fdwReason)
@@ -597,8 +596,6 @@ BOOL WINAPI DLLEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason,
        }
 #endif
 
-#endif
-
 void OpenSSLDie(const char *file,int line,const char *assertion)
        {
        fprintf(stderr,