瀏覽代碼

tests: avoid redefinition warnings for MSVC _CRT_???_NO_DEPRECATE macros

Ozkan Sezer 3 年之前
父節點
當前提交
4a22ee7277
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 4 0
      test/testautomation_surface.c
  2. 2 1
      test/testfile.c

+ 4 - 0
test/testautomation_surface.c

@@ -4,8 +4,12 @@
  */
 
 /* Supress C4996 VS compiler warnings for unlink() */
+#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
 #define _CRT_SECURE_NO_DEPRECATE
+#endif
+#if defined(_MSC_VER) && !defined(_CRT_NONSTDC_NO_DEPRECATE)
 #define _CRT_NONSTDC_NO_DEPRECATE
+#endif
 
 #include <stdio.h>
 #ifndef _MSC_VER

+ 2 - 1
test/testfile.c

@@ -13,11 +13,12 @@
 /* sanity tests on SDL_rwops.c (usefull for alternative implementations of stdio rwops) */
 
 /* quiet windows compiler warnings */
+#if defined(_MSC_VER) && !defined(_CRT_NONSTDC_NO_WARNINGS)
 #define _CRT_NONSTDC_NO_WARNINGS
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
-
 #ifndef _MSC_VER
 #include <unistd.h>
 #endif