diff -Naur mac-sdk-7.23/Shared/All.h mac-sdk-7.23-gcc/Shared/All.h
--- mac-sdk-7.23/Shared/All.h	2021-11-21 01:04:17.947172500 +0100
+++ mac-sdk-7.23-gcc/Shared/All.h	2021-12-12 18:04:04.234298400 +0100
@@ -193,12 +193,22 @@
     #define TICK_COUNT_FREQ                             1000000
     #undef    ASSERT
     #define ASSERT(e)
+#endif
+
+#if !defined(PLATFORM_WINDOWS) || !defined(_MSC_VER)
     #define wcsncpy_s(A, B, C, D) wcsncpy(A, C, D)
     #define wcscpy_s(A, B, C) wcscpy(A, C)
     #define wcscat_s(A, B, C) wcscat(A, C)
-    #define sprintf_s(A, B, C, D) sprintf(A, C, D)
+    #define sprintf_s(A, B, C, ...) sprintf(A, C, __VA_ARGS__)
+    #define _stprintf_s(A, B, C, ...) _stprintf(A, C, __VA_ARGS__)
     #define strcpy_s(A, B, C) strcpy(A, C)
-    #define _tcscat_s(A, B, C) _tcscat(A, C)
+
+    #if defined(PLATFORM_WINDOWS)
+        #define _tcsncpy_s(A, B, C, D) _tcsncpy(A, C, D)
+        #define _tcscpy_s(A, B, C) _tcscpy(A, C)
+        #define _tcscat_s(A, B, C) _tcscat(A, C)
+        #define strncpy_s(A, B, C, D) strncpy(A, C, D)
+    #endif
 #endif
 
 /**************************************************************************************************
diff -Naur mac-sdk-7.23/Shared/NoWindows.h mac-sdk-7.23-gcc/Shared/NoWindows.h
--- mac-sdk-7.23/Shared/NoWindows.h	2021-07-12 18:23:35.514497600 +0200
+++ mac-sdk-7.23-gcc/Shared/NoWindows.h	2021-08-05 01:26:09.462391800 +0200
@@ -61,7 +61,7 @@
 
 #define _strnicmp strncasecmp
 #define _wtoi(x) wcstol(x, NULL, 10)
-#define _tcscat wcscat
+#define _tcscat_s wcscat_s
 #undef _totlower
 #define _totlower towlower
 #define _totupper towupper
@@ -69,7 +69,7 @@
 #ifdef _MSC_VER
 #define _tcsicmp _wcsicmp
 #else
-#define _tcsicmp wcscasecmp
+#define _tcsicmp wcscmp
 #endif
 #define _tcscpy wcscpy
 #define _tcslen wcslen
diff -Naur mac-sdk-7.23/Source/MACLib/NewPredictor.h mac-sdk-7.23-gcc/Source/MACLib/NewPredictor.h
--- mac-sdk-7.23/Source/MACLib/NewPredictor.h	2021-11-23 18:05:49.409576400 +0100
+++ mac-sdk-7.23-gcc/Source/MACLib/NewPredictor.h	2021-12-13 13:42:50.974544600 +0100
@@ -42,9 +42,9 @@
     // other
     int m_nCurrentIndex;
     int m_nBitsPerSample;
-    CSmartPtr<CNNFilter<INTTYPE>> m_spNNFilter;
-    CSmartPtr<CNNFilter<INTTYPE>> m_spNNFilter1;
-    CSmartPtr<CNNFilter<INTTYPE>> m_spNNFilter2;
+    CSmartPtr< CNNFilter<INTTYPE> > m_spNNFilter;
+    CSmartPtr< CNNFilter<INTTYPE> > m_spNNFilter1;
+    CSmartPtr< CNNFilter<INTTYPE> > m_spNNFilter2;
 };
 
 class CPredictorDecompressNormal3930to3950 : public IPredictorDecompress
@@ -69,8 +69,8 @@
     // other
     int m_nCurrentIndex;
     int m_nLastValue;
-    CSmartPtr<CNNFilter<int>> m_spNNFilter;
-    CSmartPtr<CNNFilter<int>> m_spNNFilter1;
+    CSmartPtr< CNNFilter<int> > m_spNNFilter;
+    CSmartPtr< CNNFilter<int> > m_spNNFilter1;
 };
 
 template <class INTTYPE> class CPredictorDecompress3950toCurrent : public IPredictorDecompress
@@ -104,9 +104,9 @@
     INTTYPE m_nLastValueA;
     int m_nVersion;
     int m_nBitsPerSample;
-    CSmartPtr<CNNFilter<INTTYPE>> m_spNNFilter;
-    CSmartPtr<CNNFilter<INTTYPE>> m_spNNFilter1;
-    CSmartPtr<CNNFilter<INTTYPE>> m_spNNFilter2;
+    CSmartPtr< CNNFilter<INTTYPE> > m_spNNFilter;
+    CSmartPtr< CNNFilter<INTTYPE> > m_spNNFilter1;
+    CSmartPtr< CNNFilter<INTTYPE> > m_spNNFilter2;
     bool m_bLegacyDecode;
 };
 
diff -Naur mac-sdk-7.23/Source/Shared/All.h mac-sdk-7.23-gcc/Source/Shared/All.h
--- mac-sdk-7.23/Source/Shared/All.h	2021-11-21 01:04:17.947172500 +0100
+++ mac-sdk-7.23-gcc/Source/Shared/All.h	2021-12-12 18:04:04.234298400 +0100
@@ -193,12 +193,22 @@
     #define TICK_COUNT_FREQ                             1000000
     #undef    ASSERT
     #define ASSERT(e)
+#endif
+
+#if !defined(PLATFORM_WINDOWS) || !defined(_MSC_VER)
     #define wcsncpy_s(A, B, C, D) wcsncpy(A, C, D)
     #define wcscpy_s(A, B, C) wcscpy(A, C)
     #define wcscat_s(A, B, C) wcscat(A, C)
-    #define sprintf_s(A, B, C, D) sprintf(A, C, D)
+    #define sprintf_s(A, B, C, ...) sprintf(A, C, __VA_ARGS__)
+    #define _stprintf_s(A, B, C, ...) _stprintf(A, C, __VA_ARGS__)
     #define strcpy_s(A, B, C) strcpy(A, C)
-    #define _tcscat_s(A, B, C) _tcscat(A, C)
+
+    #if defined(PLATFORM_WINDOWS)
+        #define _tcsncpy_s(A, B, C, D) _tcsncpy(A, C, D)
+        #define _tcscpy_s(A, B, C) _tcscpy(A, C)
+        #define _tcscat_s(A, B, C) _tcscat(A, C)
+        #define strncpy_s(A, B, C, D) strncpy(A, C, D)
+    #endif
 #endif
 
 /**************************************************************************************************
diff -Naur mac-sdk-7.23/Source/Shared/NoWindows.h mac-sdk-7.23-gcc/Source/Shared/NoWindows.h
--- mac-sdk-7.23/Source/Shared/NoWindows.h	2021-07-12 18:23:35.514497600 +0200
+++ mac-sdk-7.23-gcc/Source/Shared/NoWindows.h	2021-08-05 01:26:09.475387900 +0200
@@ -61,7 +61,7 @@
 
 #define _strnicmp strncasecmp
 #define _wtoi(x) wcstol(x, NULL, 10)
-#define _tcscat wcscat
+#define _tcscat_s wcscat_s
 #undef _totlower
 #define _totlower towlower
 #define _totupper towupper
@@ -69,7 +69,7 @@
 #ifdef _MSC_VER
 #define _tcsicmp _wcsicmp
 #else
-#define _tcsicmp wcscasecmp
+#define _tcsicmp wcscmp
 #endif
 #define _tcscpy wcscpy
 #define _tcslen wcslen
