From 4da53803d2cf67a01d4130f3f5254cd2e42b83b3 Mon Sep 17 00:00:00 2001 From: u0u0 Date: Tue, 1 Mar 2022 18:33:19 +0800 Subject: [PATCH] fix win32 build with vs2019, snprintf not rdefine to _snprintf --- cocos/platform/win32/CCStdC-win32.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/platform/win32/CCStdC-win32.h b/cocos/platform/win32/CCStdC-win32.h index 45114e8..764488f 100644 --- a/cocos/platform/win32/CCStdC-win32.h +++ b/cocos/platform/win32/CCStdC-win32.h @@ -47,12 +47,6 @@ typedef SSIZE_T ssize_t; #endif #endif -#if _MSC_VER < 1900 -#ifndef snprintf -#define snprintf _snprintf -#endif -#endif - #endif // __MINGW32__ #include @@ -62,6 +56,12 @@ typedef SSIZE_T ssize_t; #include #include +#ifndef __MINGW32__ +#ifndef snprintf +#define snprintf _snprintf // must after #include , _snprintf is safty +#endif +#endif // __MINGW32__ + #ifndef M_PI #define M_PI 3.14159265358 #endif