diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2019-07-22 23:07:44 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2019-07-22 23:07:44 +0200 |
commit | 4d8af5e4b998fccc8c9a5d5505866f4722f64954 (patch) | |
tree | ffedb0e0bf41efdfff4b70db50391667ca2bae5e /upb | |
parent | 6e85c2bf036c4a18a45224dd9d929ab3639e67f3 (diff) |
Adding (v)snprintf and va_copy for Windows.
Diffstat (limited to 'upb')
-rw-r--r-- | upb/port_def.inc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/upb/port_def.inc b/upb/port_def.inc index 1b343d8..5220c29 100644 --- a/upb/port_def.inc +++ b/upb/port_def.inc @@ -71,6 +71,14 @@ #define UPB_NORETURN #endif +#if defined(_WIN32) || defined(WIN32) +/* Windows versions */ +#include <stdarg.h> +#include <stdio.h> +#define _upb_snprintf _snprintf_s +#define _upb_vsnprintf _vsnprintf_s +#define _upb_va_copy(a, b) va_copy(a, b) +#else #if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L /* C99/C++11 versions. */ #include <stdio.h> @@ -89,6 +97,7 @@ #else #error Need implementations of [v]snprintf and va_copy #endif +#endif #ifdef __cplusplus #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || \ |