From f179e23e5b9f502cce9a2b9fa6a918d1a689758b Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Mon, 29 Jul 2019 18:12:55 -0700 Subject: [PATCH] Support Visual Studio --- upb/port_def.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/upb/port_def.inc b/upb/port_def.inc index 5220c2917c..05c4ebcb6a 100644 --- a/upb/port_def.inc +++ b/upb/port_def.inc @@ -75,8 +75,13 @@ /* Windows versions */ #include #include -#define _upb_snprintf _snprintf_s -#define _upb_vsnprintf _vsnprintf_s +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define _upb_snprintf _snprintf +#define _upb_vsnprintf _vsnprintf +#else +#define _upb_snprintf snprintf +#define _upb_vsnprintf vsnprintf +#endif #define _upb_va_copy(a, b) va_copy(a, b) #else #if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L