tests: avoid redefinition warnings for MSVC _CRT_???_NO_DEPRECATE macros
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c
index 6619d7a..41aa241 100644
--- a/test/testautomation_surface.c
+++ b/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
diff --git a/test/testfile.c b/test/testfile.c
index 1a2f15a..13bcb5a 100644
--- a/test/testfile.c
+++ b/test/testfile.c
@@ -13,19 +13,18 @@
/* 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
#include "SDL.h"
-
-#include <stdio.h>
-
/* WARNING ! those 2 files will be destroyed by this test program */
#ifdef __IPHONEOS__