]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix MINGW compilation
authorMilan Broz <gmazyland@gmail.com>
Mon, 23 Mar 2026 15:15:06 +0000 (16:15 +0100)
committerTomas Mraz <tomas@openssl.foundation>
Wed, 25 Mar 2026 14:12:53 +0000 (15:12 +0100)
This patch fixes
  undefined reference to `ossl_BIO_snprintf_msvc'

Define it only if MSVC is used.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Wed Mar 25 14:12:58 2026
(Merged from https://github.com/openssl/openssl/pull/30541)

crypto/bio/bio_print.c
include/internal/bio.h
test/bioprinttest.c

index ea77be404671a93188192fbaf741f69323407642..8b0c3481f00dbf94058d3f6b7a30114e8054e5fd 100644 (file)
@@ -72,7 +72,7 @@ static int msvc_bio_vprintf(BIO *bio, const char *format, va_list args)
 }
 #endif
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 /*
  * This function is for unit test on windows only when built with Visual Studio
  */
index e814a269d61ff70d789027813b1e6bc8c711b24d..91a27b22185aa5dfaa4bf6d1e78ff7402ddc6831 100644 (file)
@@ -107,7 +107,7 @@ int ossl_core_bio_vprintf(OSSL_CORE_BIO *cb, const char *format, va_list args);
 
 int ossl_bio_init_core(OSSL_LIB_CTX *libctx, const OSSL_DISPATCH *fns);
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 int ossl_BIO_snprintf_msvc(char *buf, size_t n, const char *fmt, ...);
 #endif
 
index fb7d9d82d6f665ebc05c55f446fa078c69c569d5..bbf6dcc056d55023f00e8b4c7f5b383e49f900f7 100644 (file)
@@ -315,7 +315,7 @@ static int test_int(int i)
     return 1;
 }
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 static int test_int_win32(int i)
 {
     int ret;
@@ -460,7 +460,7 @@ static int test_width_precision(int i)
     return 1;
 }
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 static int test_width_precision_win32(int i)
 {
     int ret;
@@ -691,7 +691,7 @@ static int test_zu(int i)
     return 1;
 }
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 static int test_zu_win32(int i)
 {
     int ret;
@@ -734,7 +734,7 @@ static int test_t(int i)
     return 1;
 }
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 static int test_t_win32(int i)
 {
     int ret;
@@ -781,7 +781,7 @@ static int test_j(int i)
     return 1;
 }
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 static int test_j_win32(int i)
 {
     int ret;
@@ -877,7 +877,7 @@ static int test_fp(int i)
     return r;
 }
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 static int test_fp_win32(int i)
 {
     int ret;
@@ -931,7 +931,7 @@ int setup_tests(void)
     ADD_ALL_TESTS(test_t, OSSL_NELEM(t_data));
     ADD_ALL_TESTS(test_j, OSSL_NELEM(jf_data));
 
-#ifdef _WIN32
+#ifdef _MSC_VER
     /*
      * those tests are using _vsnprintf_s()
      */