Because libraries on Windows lack useful version information, the zlib
authorRichard Levitte <levitte@openssl.org>
Thu, 14 Oct 2004 05:48:59 +0000 (05:48 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 14 Oct 2004 05:48:59 +0000 (05:48 +0000)
guys had to change the name to differentiate with older versions when
a backward incompatibility came up.  Of course, we need to adapt.
This change simply tries to load the library through the newer name
(ZLIB1) first, and if that fails, it tries the good old ZLIB.

crypto/comp/c_zlib.c

index 7553a2d107e52589e16b0db2935de5ead5520808..64101bd084cfd32b883d3dd7ebe9e7312de77358 100644 (file)
@@ -357,7 +357,17 @@ COMP_METHOD *COMP_zlib(void)
        if (!zlib_loaded)
                {
 #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
        if (!zlib_loaded)
                {
 #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-               zlib_dso = DSO_load(NULL, "ZLIB", NULL, 0);
+               zlib_dso = DSO_load(NULL, "ZLIB1", NULL, 0);
+               if (!zlib_dso)
+                       {
+                       zlib_dso = DSO_load(NULL, "ZLIB", NULL, 0);
+                       if (zlib_dso)
+                               {
+                               /* Clear the errors from the first failed
+                                  DSO_load() */
+                               ERR_clear_error();
+                               }
+                       }
 #else
                zlib_dso = DSO_load(NULL, "z", NULL, 0);
 #endif
 #else
                zlib_dso = DSO_load(NULL, "z", NULL, 0);
 #endif