]> granicus.if.org Git - openssl/commitdiff
Engage DllMain on Windows. Partial backport from HEAD. Unlike HEAD,
authorAndy Polyakov <appro@openssl.org>
Thu, 7 Apr 2005 16:06:03 +0000 (16:06 +0000)
committerAndy Polyakov <appro@openssl.org>
Thu, 7 Apr 2005 16:06:03 +0000 (16:06 +0000)
it doesn't get engaged on __CYGWIN__, because I'm not sure is *all*
Cygwin installations are equipped with windows.h...

Configure
TABLE
crypto/cryptlib.c

index 3b7bcb5d838ffb613ce482284ba0b81408682499..e0e732c445c81fc0ee3e8c705f779803f8ac728c 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -530,14 +530,14 @@ my %table=(
 "BC-16","bcc:::(unknown):WIN16::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::",
 
 # MinGW
-"mingw", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -mno-cygwin -Wall:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:-D_DLL:-mno-cygwin:.dll",
+"mingw", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -mno-cygwin -Wall:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll",
 
 # UWIN 
 "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
 
 # Cygwin
 "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
-"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:cygwin-shared:::.dll",
+"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:cygwin-shared:-D_WINDLL::.dll",
 
 # DJGPP
 "DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall -DDEVRANDOM=\"/dev/urandom\\x24\":::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
diff --git a/TABLE b/TABLE
index eb5600203db26163162ef3e9a6de8697999ebc52..530fb011befaa8692568a9ed57bf728a1a870f83 100644 (file)
--- a/TABLE
+++ b/TABLE
@@ -94,7 +94,7 @@ $rmd160_obj   = asm/rm86-out.o
 $rc5_obj      = asm/r586-out.o
 $dso_scheme   = dlfcn
 $shared_target= cygwin-shared
-$shared_cflag = 
+$shared_cflag = -D_WINDLL
 $shared_ldflag = 
 $shared_extension = .dll
 $ranlib       = 
@@ -3569,7 +3569,7 @@ $rmd160_obj   = asm/rm86-out.o
 $rc5_obj      = asm/r586-out.o
 $dso_scheme   = win32
 $shared_target= cygwin-shared
-$shared_cflag = -D_DLL
+$shared_cflag = -D_WINDLL
 $shared_ldflag = -mno-cygwin
 $shared_extension = .dll
 $ranlib       = 
index b8e700ce526f15ae8fa06724f8e0ed1cc3b21292..fef0afb29fca6eb234896b25c406664d0f2b0608 100644 (file)
@@ -480,13 +480,12 @@ const char *CRYPTO_get_lock_name(int type)
                return(sk_value(app_locks,type-CRYPTO_NUM_LOCKS));
        }
 
-#ifdef _DLL
-#ifdef OPENSSL_SYS_WIN32
+#if defined(_WIN32) && defined(_WINDLL)
 
 /* 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)
@@ -505,8 +504,6 @@ BOOL WINAPI DLLEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason,
        }
 #endif
 
-#endif
-
 void OpenSSLDie(const char *file,int line,const char *assertion)
        {
        fprintf(stderr,