aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBob Beck <[email protected]>2026-06-22 19:06:55 +0200
committerNeil Horman <[email protected]>2026-08-26 18:20:02 +0200
commitc0fd83dc7c25f046c266a44ccb178a8b7e8a4572 (patch)
treef8c60e94bc99a8c0943bb288f9f1d227a00abb6f /include
parentApply DNS name constraints to the subject CN only when it may match (diff)
downloadopenssl-c0fd83dc7c25f046c266a44ccb178a8b7e8a4572.tar.gz
openssl-c0fd83dc7c25f046c266a44ccb178a8b7e8a4572.zip
Add a build target for MSVC 2013
Apparently it is desired to keep this on life support. So we add a build target for this non-C99 platform, and provide internal versions of snprintf and vsnprintf for use only on this platform that match the C99 semantics. This allows us to use C99 semantics normally elsewhere. Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Andrew Dinh <[email protected]> MergeDate: Wed Aug 26 16:20:04 2026 (Merged from https://github.com/openssl/openssl/pull/31640)
Diffstat (limited to 'include')
-rw-r--r--include/internal/bio.h4
-rw-r--r--include/internal/e_os.h14
2 files changed, 14 insertions, 4 deletions
diff --git a/include/internal/bio.h b/include/internal/bio.h
index 91a27b22185..bec4242b261 100644
--- a/include/internal/bio.h
+++ b/include/internal/bio.h
@@ -107,8 +107,4 @@ 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 _MSC_VER
-int ossl_BIO_snprintf_msvc(char *buf, size_t n, const char *fmt, ...);
-#endif
-
#endif
diff --git a/include/internal/e_os.h b/include/internal/e_os.h
index 444f888674b..4fb1840f618 100644
--- a/include/internal/e_os.h
+++ b/include/internal/e_os.h
@@ -152,6 +152,20 @@ FILE *__iob_func(void);
#define check_win_minplat(x) (LOBYTE(LOWORD(GetVersion())) >= (x))
#endif
+/*
+ * MSVC versions earlier than Visual Studio 2015 (_MSC_VER < 1900) do not
+ * declare or define C99 snprintf or vsnprintf. Definitions are supplied
+ * by crypto/msvc2013_snprintf.c, which is built only on the matching
+ * Configure target variants.
+ */
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#include <stdarg.h>
+int msvc_translate_printf_format(const char *format, const char **out,
+ char **tmp);
+int snprintf(char *buf, size_t n, const char *fmt, ...);
+int vsnprintf(char *buf, size_t n, const char *fmt, va_list args);
+#endif
+
#else /* The non-microsoft world */
#if defined(OPENSSL_SYS_VXWORKS)