Commit b7a42c6a3c for openssl.org

commit b7a42c6a3c5fe58a613e6d34ee5c23a5c072c5e2
Author: Richard Levitte <levitte@openssl.org>
Date:   Wed Feb 25 15:38:17 2026 +0100

    crypto/bio/bio_print.c: maintain consistent MSVC feature macro guards

    Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
    Reviewed-by: Paul Dale <paul.dale@oracle.com>
    Reviewed-by: Tomas Mraz <tomas@openssl.org>
    MergeDate: Thu Feb 26 17:12:02 2026
    (Merged from https://github.com/openssl/openssl/pull/30177)

diff --git a/crypto/bio/bio_print.c b/crypto/bio/bio_print.c
index 2a78cd6373..730587ff26 100644
--- a/crypto/bio/bio_print.c
+++ b/crypto/bio/bio_print.c
@@ -28,7 +28,7 @@ int BIO_printf(BIO *bio, const char *format, ...)
     return ret;
 }

-#if defined(_WIN32)
+#if defined(_MSC_VER) && _MSC_VER < 1900
 /*
  * _MSC_VER described here:
  * https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170
@@ -70,7 +70,9 @@ static int msvc_bio_vprintf(BIO *bio, const char *format, va_list args)

     return ret;
 }
+#endif

+#ifdef _WIN32
 /*
  * This function is for unit test on windows only when built with Visual Studio
  */
@@ -85,13 +87,12 @@ int ossl_BIO_snprintf_msvc(char *buf, size_t n, const char *format, ...)

     return ret;
 }
-
 #endif

 int BIO_vprintf(BIO *bio, const char *format, va_list args)
 {
     va_list cp_args;
-#if !defined(_MSC_VER) || _MSC_VER > 1900
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
     int sz;
 #endif
     int ret = -1;