diff -Naur mac-sdk-5.55/Makefile mac-sdk-5.55-gcc/Makefile
--- mac-sdk-5.55/Makefile	1970-01-01 00:00:00 +0000
+++ mac-sdk-5.55-gcc/Makefile	2019-11-21 21:28:57 +0000
@@ -0,0 +1,8 @@
+all:
+	$(MAKE) -f Source/Projects/NonWindows/Makefile
+
+install:
+	$(MAKE) -f Source/Projects/NonWindows/Makefile install
+
+clean:
+	$(MAKE) -f Source/Projects/NonWindows/Makefile clean
diff -Naur mac-sdk-5.55/Shared/All.h mac-sdk-5.55-gcc/Shared/All.h
--- mac-sdk-5.55/Shared/All.h	2020-09-14 12:36:34 +0000
+++ mac-sdk-5.55-gcc/Shared/All.h	2020-09-26 23:14:27 +0000
@@ -121,46 +121,17 @@
 #define ENABLE_COMPRESSION_MODE_HIGH
 #define ENABLE_COMPRESSION_MODE_EXTRA_HIGH
 
-// 64 bit platform
-#ifdef PLATFORM_64BIT
-    #ifndef PLATFORM_x64
-        #define PLATFORM_x64
-    #endif
-#endif
-
-#if __x86_64__ || __aarch64__
-    #ifndef PLATFORM_x64
-        #define PLATFORM_x64
-    #endif
-#endif
-
 /*****************************************************************************************
 Global types
 *****************************************************************************************/
 namespace APE
 {
     // integer types
-#if defined(PLATFORM_x64)
-    typedef int64_t                                     int64; // native integer, can safely hold a pointer
     typedef int32_t                                     int32;
-#else
-    typedef intptr_t                                    int32; // native integer, can safely hold a pointer
     typedef int64_t                                     int64;
-#endif
 
-#if defined(PLATFORM_x64)
-// DO NOT CHANGE THE FOLLOWING 6 LINES! They are necessary for building Media Center 64 bit on non-windows platforms!
-    #ifndef PLATFORM_WINDOWS
-        typedef long long intn;
-        typedef unsigned long long uintn;
-    #else
-        typedef int64_t intn;
-        typedef uint64_t uintn;
-    #endif    
-#else
-    typedef int32_t intn;
-    typedef uint32_t uintn;
-#endif
+    typedef intptr_t                                    intn; // native integer, can safely hold a pointer
+    typedef uintptr_t                                   uintn;
 
     typedef uint64_t                                    uint64;
     typedef uint32_t                                    uint32;
@@ -219,12 +190,21 @@
     #define TICK_COUNT_FREQ                             1000000
     #undef    ASSERT
     #define ASSERT(e)
+#endif
+
+#if !defined(PLATFORM_WINDOWS) || !defined(_MSC_VER)
     #define wcsncpy_s(A, B, COUNT) wcsncpy(A, B, COUNT)
     #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, COUNT) _tcsncpy(A, C, COUNT)
+        #define _tcscpy_s(A, B, C) _tcscpy(A, C)
+        #define _tcscat_s(A, B, C) _tcscat(A, C)
+    #endif
 #endif
 
 /*****************************************************************************************
diff -Naur mac-sdk-5.55/Shared/NoWindows.h mac-sdk-5.55-gcc/Shared/NoWindows.h
--- mac-sdk-5.55/Shared/NoWindows.h	2020-07-21 19:27:20 +0000
+++ mac-sdk-5.55-gcc/Shared/NoWindows.h	2020-08-29 18:25:57 +0000
@@ -46,7 +46,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
@@ -54,7 +54,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-5.55/Source/MACLib/APEInfo.cpp mac-sdk-5.55-gcc/Source/MACLib/APEInfo.cpp
--- mac-sdk-5.55/Source/MACLib/APEInfo.cpp	2020-04-13 22:37:20 +0000
+++ mac-sdk-5.55-gcc/Source/MACLib/APEInfo.cpp	2020-08-29 17:53:56 +0000
@@ -15,7 +15,7 @@
 /*****************************************************************************************
 Construction
 *****************************************************************************************/
-CAPEInfo::CAPEInfo(int * pErrorCode, const wchar_t * pFilename, CAPETag * pTag, bool bAPL)
+CAPEInfo::CAPEInfo(int * pErrorCode, const wchar_t * pFilename, CAPETag * pTag, bool bAPL, bool bReadOnly)
 {
     *pErrorCode = ERROR_SUCCESS;
     CloseFile();
@@ -26,7 +26,7 @@
     // open the file
     m_spIO.Assign(new IO_CLASS_NAME);
     
-    if (m_spIO->Open(pFilename) != 0)
+    if (m_spIO->Open(pFilename, bReadOnly) != 0)
     {
         CloseFile();
         *pErrorCode = ERROR_INVALID_INPUT_FILE;
diff -Naur mac-sdk-5.55/Source/MACLib/APEInfo.h mac-sdk-5.55-gcc/Source/MACLib/APEInfo.h
--- mac-sdk-5.55/Source/MACLib/APEInfo.h	2020-09-14 12:55:01 +0000
+++ mac-sdk-5.55-gcc/Source/MACLib/APEInfo.h	2020-09-26 23:14:54 +0000
@@ -75,7 +75,7 @@
 public:
     
     // construction and destruction
-    CAPEInfo(int * pErrorCode, const wchar_t * pFilename, CAPETag * pTag = NULL, bool bAPL = false);
+    CAPEInfo(int * pErrorCode, const wchar_t * pFilename, CAPETag * pTag = NULL, bool bAPL = false, bool bReadOnly = false);
     CAPEInfo(int * pErrorCode, APE::CIO * pIO, CAPETag * pTag = NULL);
     virtual ~CAPEInfo();
 
diff -Naur mac-sdk-5.55/Source/MACLib/MACLib.cpp mac-sdk-5.55-gcc/Source/MACLib/MACLib.cpp
--- mac-sdk-5.55/Source/MACLib/MACLib.cpp	2020-06-29 18:37:41 +0000
+++ mac-sdk-5.55-gcc/Source/MACLib/MACLib.cpp	2020-08-29 17:47:30 +0000
@@ -94,7 +94,7 @@
     else if (StringIsEqual(pExtension, L".mac", false) || StringIsEqual(pExtension, L".ape", false))
     {
         // plain .ape file
-        pAPEInfo = new CAPEInfo(&nErrorCode, pFilename);
+        pAPEInfo = new CAPEInfo(&nErrorCode, pFilename, NULL, false, true);
     }
 
     // fail if we couldn't get the file information
diff -Naur mac-sdk-5.55/Source/Projects/NonWindows/Makefile mac-sdk-5.55-gcc/Source/Projects/NonWindows/Makefile
--- mac-sdk-5.55/Source/Projects/NonWindows/Makefile	2020-04-24 21:09:10 +0000
+++ mac-sdk-5.55-gcc/Source/Projects/NonWindows/Makefile	2020-08-29 17:45:44 +0000
@@ -85,7 +85,7 @@
 	$(CC) $(SHAREDOBJECTS) $(LIBOBJECTS) $(DLLOBJECTS) $(LDOPTS) $(LDFLAGS) $(DLLLDOPTS) -o $@
 
 $(CMDNAME): $(DLLNAME) $(CMDOBJECTS)
-	$(CC) $(SHAREDOBJECTS) $(CMDOBJECTS) $(DLLNAME) $(LDOPTS) $(LDFLAGS) $(CMDLDOPTS) -o $@
+	$(CC) $(SHAREDOBJECTS) $(LIBOBJECTS) $(CMDOBJECTS) $(LDOPTS) $(LDFLAGS) $(CMDLDOPTS) -o $@
 
 Source/Shared/%.o: Source/Shared/%.cpp
 	$(CXX) $(CXXOPTS) $(CXXFLAGS) $< -o $@
diff -Naur mac-sdk-5.55/Source/Shared/All.h mac-sdk-5.55-gcc/Source/Shared/All.h
--- mac-sdk-5.55/Source/Shared/All.h	2020-09-14 12:36:34 +0000
+++ mac-sdk-5.55-gcc/Source/Shared/All.h	2020-09-26 23:14:36 +0000
@@ -121,46 +121,17 @@
 #define ENABLE_COMPRESSION_MODE_HIGH
 #define ENABLE_COMPRESSION_MODE_EXTRA_HIGH
 
-// 64 bit platform
-#ifdef PLATFORM_64BIT
-    #ifndef PLATFORM_x64
-        #define PLATFORM_x64
-    #endif
-#endif
-
-#if __x86_64__ || __aarch64__
-    #ifndef PLATFORM_x64
-        #define PLATFORM_x64
-    #endif
-#endif
-
 /*****************************************************************************************
 Global types
 *****************************************************************************************/
 namespace APE
 {
     // integer types
-#if defined(PLATFORM_x64)
-    typedef int64_t                                     int64; // native integer, can safely hold a pointer
     typedef int32_t                                     int32;
-#else
-    typedef intptr_t                                    int32; // native integer, can safely hold a pointer
     typedef int64_t                                     int64;
-#endif
 
-#if defined(PLATFORM_x64)
-// DO NOT CHANGE THE FOLLOWING 6 LINES! They are necessary for building Media Center 64 bit on non-windows platforms!
-    #ifndef PLATFORM_WINDOWS
-        typedef long long intn;
-        typedef unsigned long long uintn;
-    #else
-        typedef int64_t intn;
-        typedef uint64_t uintn;
-    #endif    
-#else
-    typedef int32_t intn;
-    typedef uint32_t uintn;
-#endif
+    typedef intptr_t                                    intn; // native integer, can safely hold a pointer
+    typedef uintptr_t                                   uintn;
 
     typedef uint64_t                                    uint64;
     typedef uint32_t                                    uint32;
@@ -219,12 +190,21 @@
     #define TICK_COUNT_FREQ                             1000000
     #undef    ASSERT
     #define ASSERT(e)
+#endif
+
+#if !defined(PLATFORM_WINDOWS) || !defined(_MSC_VER)
     #define wcsncpy_s(A, B, COUNT) wcsncpy(A, B, COUNT)
     #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, COUNT) _tcsncpy(A, C, COUNT)
+        #define _tcscpy_s(A, B, C) _tcscpy(A, C)
+        #define _tcscat_s(A, B, C) _tcscat(A, C)
+    #endif
 #endif
 
 /*****************************************************************************************
diff -Naur mac-sdk-5.55/Source/Shared/NoWindows.h mac-sdk-5.55-gcc/Source/Shared/NoWindows.h
--- mac-sdk-5.55/Source/Shared/NoWindows.h	2020-07-21 19:27:20 +0000
+++ mac-sdk-5.55-gcc/Source/Shared/NoWindows.h	2020-08-29 18:25:57 +0000
@@ -46,7 +46,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
@@ -54,7 +54,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-5.55/configure mac-sdk-5.55-gcc/configure
--- mac-sdk-5.55/configure	1970-01-01 00:00:00 +0000
+++ mac-sdk-5.55-gcc/configure	2019-11-21 21:28:57 +0000
@@ -0,0 +1 @@
+#!/bin/sh
