SDL: tests: avoid redefinition warnings for MSVC _CRT_???_NO_DEPRECATE macros (4a22e)

From 4a22ee72779243ce2ca5f090c208a4cdc5625a93 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 5 Dec 2022 00:35:20 +0300
Subject: [PATCH] tests: avoid redefinition warnings for MSVC
 _CRT_???_NO_DEPRECATE macros

---
 test/testautomation_surface.c | 4 ++++
 test/testfile.c               | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c
index ec0dd07a91d3..a8ff8a107915 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 ba7d2af300ca..07da6e64b47d 100644
--- a/test/testfile.c
+++ b/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