diff options
| author | Bob Beck <[email protected]> | 2026-06-22 19:06:55 +0200 |
|---|---|---|
| committer | Neil Horman <[email protected]> | 2026-08-26 18:20:02 +0200 |
| commit | c0fd83dc7c25f046c266a44ccb178a8b7e8a4572 (patch) | |
| tree | f8c60e94bc99a8c0943bb288f9f1d227a00abb6f /apps | |
| parent | Apply DNS name constraints to the subject CN only when it may match (diff) | |
| download | openssl-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 'apps')
| -rw-r--r-- | apps/include/platform.h | 14 | ||||
| -rw-r--r-- | apps/lib/build.info | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/apps/include/platform.h b/apps/include/platform.h index ec12a41af7c..74a93856294 100644 --- a/apps/include/platform.h +++ b/apps/include/platform.h @@ -29,4 +29,18 @@ char **copy_argv(int *argc, char *argv[]); void win32_utf8argv(int *argc, char **argv[]); #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 + #endif diff --git a/apps/lib/build.info b/apps/lib/build.info index a781117264e..9512a43b763 100644 --- a/apps/lib/build.info +++ b/apps/lib/build.info @@ -21,3 +21,7 @@ ENDIF IF[{- !$disabled{srp} -}] SOURCE[../libapps.a]=tlssrp_depr.c ENDIF + +IF[{- $target{needs_c99_snprintf_compat} -}] + SOURCE[../libapps.a]=../../crypto/msvc2013_snprintf.c +ENDIF |
