SDL_image: fix -Wundef warning '"_MSC_VER" is not defined, evaluates to 0'

From c9c809b3d488afbcc9d33228f0c50cc04ce4611c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 25 Jan 2024 14:10:05 -0800
Subject: [PATCH] fix -Wundef warning '"_MSC_VER" is not defined, evaluates to
 0'

---
 src/IMG_avif.c | 2 +-
 src/IMG_bmp.c  | 2 +-
 src/IMG_gif.c  | 2 +-
 src/IMG_jpg.c  | 2 +-
 src/IMG_jxl.c  | 2 +-
 src/IMG_lbm.c  | 2 +-
 src/IMG_pcx.c  | 2 +-
 src/IMG_png.c  | 2 +-
 src/IMG_pnm.c  | 2 +-
 src/IMG_qoi.c  | 2 +-
 src/IMG_svg.c  | 2 +-
 src/IMG_tga.c  | 2 +-
 src/IMG_tif.c  | 2 +-
 src/IMG_webp.c | 2 +-
 src/IMG_xcf.c  | 2 +-
 src/IMG_xpm.c  | 2 +-
 src/IMG_xv.c   | 2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/IMG_avif.c b/src/IMG_avif.c
index 909ac836..dfa97d35 100644
--- a/src/IMG_avif.c
+++ b/src/IMG_avif.c
@@ -469,7 +469,7 @@ SDL_Surface *IMG_LoadAVIF_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_bmp.c b/src/IMG_bmp.c
index f0ad6758..35a31380 100644
--- a/src/IMG_bmp.c
+++ b/src/IMG_bmp.c
@@ -453,7 +453,7 @@ SDL_Surface *IMG_LoadCUR_RW(SDL_RWops *src)
 
 #else
 
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_gif.c b/src/IMG_gif.c
index e4895087..bcca0c91 100644
--- a/src/IMG_gif.c
+++ b/src/IMG_gif.c
@@ -789,7 +789,7 @@ SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_jpg.c b/src/IMG_jpg.c
index da446872..004e9517 100644
--- a/src/IMG_jpg.c
+++ b/src/IMG_jpg.c
@@ -624,7 +624,7 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src)
 #endif /* WANT_JPEGLIB */
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_jxl.c b/src/IMG_jxl.c
index 95b131d3..3008461c 100644
--- a/src/IMG_jxl.c
+++ b/src/IMG_jxl.c
@@ -249,7 +249,7 @@ SDL_Surface *IMG_LoadJXL_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_lbm.c b/src/IMG_lbm.c
index 2fab8cc9..9d608c08 100644
--- a/src/IMG_lbm.c
+++ b/src/IMG_lbm.c
@@ -496,7 +496,7 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
 }
 
 #else /* LOAD_LBM */
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_pcx.c b/src/IMG_pcx.c
index 11c1cf41..beea62a4 100644
--- a/src/IMG_pcx.c
+++ b/src/IMG_pcx.c
@@ -283,7 +283,7 @@ SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_png.c b/src/IMG_png.c
index 1382e683..d09e312e 100644
--- a/src/IMG_png.c
+++ b/src/IMG_png.c
@@ -528,7 +528,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
 #endif /* WANT_LIBPNG */
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_pnm.c b/src/IMG_pnm.c
index 3f6d3ba8..d8e6bb15 100644
--- a/src/IMG_pnm.c
+++ b/src/IMG_pnm.c
@@ -241,7 +241,7 @@ SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_qoi.c b/src/IMG_qoi.c
index d91af81c..8fd640af 100644
--- a/src/IMG_qoi.c
+++ b/src/IMG_qoi.c
@@ -107,7 +107,7 @@ SDL_Surface *IMG_LoadQOI_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_svg.c b/src/IMG_svg.c
index 1deaa830..9b2470e9 100644
--- a/src/IMG_svg.c
+++ b/src/IMG_svg.c
@@ -167,7 +167,7 @@ SDL_Surface *IMG_LoadSizedSVG_RW(SDL_RWops *src, int width, int height)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_tga.c b/src/IMG_tga.c
index afbf198e..57fe3ca5 100644
--- a/src/IMG_tga.c
+++ b/src/IMG_tga.c
@@ -321,7 +321,7 @@ SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_tif.c b/src/IMG_tif.c
index 95342b34..e6c51a27 100644
--- a/src/IMG_tif.c
+++ b/src/IMG_tif.c
@@ -215,7 +215,7 @@ SDL_Surface* IMG_LoadTIF_RW(SDL_RWops* src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_webp.c b/src/IMG_webp.c
index 829e5b0a..a698dbc7 100644
--- a/src/IMG_webp.c
+++ b/src/IMG_webp.c
@@ -379,7 +379,7 @@ IMG_Animation *IMG_LoadWEBPAnimation_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_xcf.c b/src/IMG_xcf.c
index 22687e07..f7af8942 100644
--- a/src/IMG_xcf.c
+++ b/src/IMG_xcf.c
@@ -1030,7 +1030,7 @@ SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_xpm.c b/src/IMG_xpm.c
index 5ad0546f..52dbcdff 100644
--- a/src/IMG_xpm.c
+++ b/src/IMG_xpm.c
@@ -1197,7 +1197,7 @@ SDL_Surface *IMG_ReadXPMFromArrayToRGB888(char **xpm)
 }
 
 #else  /* not LOAD_XPM */
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif
 
diff --git a/src/IMG_xv.c b/src/IMG_xv.c
index 94819403..9200379a 100644
--- a/src/IMG_xv.c
+++ b/src/IMG_xv.c
@@ -147,7 +147,7 @@ SDL_Surface *IMG_LoadXV_RW(SDL_RWops *src)
 }
 
 #else
-#if _MSC_VER >= 1300
+#if defined(_MSC_VER) && _MSC_VER >= 1300
 #pragma warning(disable : 4100) /* warning C4100: 'op' : unreferenced formal parameter */
 #endif