tests: avoid MSVC preaching about unsafe functions
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 45 46
diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c
index 96c174f..dd7ef3f 100644
--- a/test/testautomation_audio.c
+++ b/test/testautomation_audio.c
@@ -4,7 +4,9 @@
*/
/* quiet windows compiler warnings */
-#define _CRT_SECURE_NO_WARNINGS
+#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
+# define _CRT_SECURE_NO_WARNINGS
+#endif
#include <stdio.h>
#include <string.h>
diff --git a/test/testautomation_rwops.c b/test/testautomation_rwops.c
index 44e0086..f2d5627 100644
--- a/test/testautomation_rwops.c
+++ b/test/testautomation_rwops.c
@@ -10,7 +10,9 @@
*/
/* quiet windows compiler warnings */
-#define _CRT_SECURE_NO_WARNINGS
+#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
+# define _CRT_SECURE_NO_WARNINGS
+#endif
#include <stdio.h>
diff --git a/test/testiconv.c b/test/testiconv.c
index 883f8ee..fc08066 100644
--- a/test/testiconv.c
+++ b/test/testiconv.c
@@ -10,6 +10,11 @@
freely.
*/
+/* quiet windows compiler warnings */
+#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
+# define _CRT_SECURE_NO_WARNINGS
+#endif
+
#include <stdio.h>
#include "SDL.h"