From b771d9beeccf47ee1d8d0d9f7b2c1577b5830a38 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 6 Oct 2022 01:09:32 +0200
Subject: [PATCH] tests: avoid MSVC preaching about unsafe functions
---
test/testautomation_audio.c | 4 +++-
test/testautomation_rwops.c | 4 +++-
test/testiconv.c | 5 +++++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c
index 96c174f5c235..dd7ef3f113f4 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 44e0086bbac3..f2d5627e5b46 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 883f8eedfbdd..fc080661895b 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"