DLLEntryPoint is a collective name, not what linker looks for. However,
authorAndy Polyakov <appro@openssl.org>
Sun, 1 Aug 2004 14:27:43 +0000 (14:27 +0000)
committerAndy Polyakov <appro@openssl.org>
Sun, 1 Aug 2004 14:27:43 +0000 (14:27 +0000)
if we explicitly intruct the linker to set entry point, then we become
obliged to initialize run-time library. Instead we can pick name run-time
will call and such name is DllMain. Note that this applies to both
"native" Win32 environment and Cygwin:-)

crypto/cryptlib.c

index 23264ec8234b20a2919df3cf8c1851e99ca7d7bf..e0380a38f4c35104fc05ace3499f30e10051eaea 100644 (file)
@@ -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,