Commit b771d9beeccf47ee1d8d0d9f7b2c1577b5830a38

Anonymous Maarten 2022-10-06T01:09:32

tests: avoid MSVC preaching about unsafe functions

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"