Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mac-sdk-5.64-gcc.patch « mac - github.com/flathub/shared-modules.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d95601c7d9243e91d3c68649b3fb0d19d1683f9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
diff -Naur mac-sdk-5.64/Makefile mac-sdk-5.64-gcc/Makefile
--- mac-sdk-5.64/Makefile	1970-01-01 00:00:00 +0000
+++ mac-sdk-5.64-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.64/Shared/All.h mac-sdk-5.64-gcc/Shared/All.h
--- mac-sdk-5.64/Shared/All.h	2020-11-06 16:17:42 +0000
+++ mac-sdk-5.64-gcc/Shared/All.h	2020-11-06 19:59:10 +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;
@@ -217,12 +188,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-5.64/Shared/NoWindows.h mac-sdk-5.64-gcc/Shared/NoWindows.h
--- mac-sdk-5.64/Shared/NoWindows.h	2020-11-09 20:13:40 +0000
+++ mac-sdk-5.64-gcc/Shared/NoWindows.h	2020-11-10 16:17:10 +0000
@@ -52,7 +52,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
@@ -60,7 +60,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.64/Source/Console/Console.cpp mac-sdk-5.64-gcc/Source/Console/Console.cpp
--- mac-sdk-5.64/Source/Console/Console.cpp	2020-11-04 16:31:57 +0000
+++ mac-sdk-5.64-gcc/Source/Console/Console.cpp	2020-11-06 19:08:17 +0000
@@ -22,7 +22,7 @@
 #define TAG_MODE               4
 #define UNDEFINED_MODE        -1
 
-#ifndef _MSC_VER
+#ifndef PLATFORM_WINDOWS
     #define TICK_COUNT_TYPE                             unsigned long long
     #define TICK_COUNT_READ(VARIABLE)                   { struct timeval t; gettimeofday(&t, NULL); VARIABLE = t.tv_sec * 1000000LLU + t.tv_usec; }
 #else
diff -Naur mac-sdk-5.64/Source/MACLib/APEDecompress.cpp mac-sdk-5.64-gcc/Source/MACLib/APEDecompress.cpp
--- mac-sdk-5.64/Source/MACLib/APEDecompress.cpp	2020-11-24 17:01:57 +0000
+++ mac-sdk-5.64-gcc/Source/MACLib/APEDecompress.cpp	2020-11-24 19:48:33 +0000
@@ -121,7 +121,7 @@
             nResult = nDecodeRetVal;
 
         // analyze how much to remove from the buffer
-        const int64 nFrameBufferBlocks = min(m_nFrameBufferFinishedBlocks, m_cbFrameBuffer.MaxGet() / m_nBlockAlign);
+        const int64 nFrameBufferBlocks = ape_min(m_nFrameBufferFinishedBlocks, m_cbFrameBuffer.MaxGet() / m_nBlockAlign);
         nBlocksThisPass = ape_min(nBlocksLeft, nFrameBufferBlocks);
 
         // remove as much as possible
diff -Naur mac-sdk-5.64/Source/MACLib/APEInfo.cpp mac-sdk-5.64-gcc/Source/MACLib/APEInfo.cpp
--- mac-sdk-5.64/Source/MACLib/APEInfo.cpp	2020-11-02 14:06:36 +0000
+++ mac-sdk-5.64-gcc/Source/MACLib/APEInfo.cpp	2020-11-06 19:04:04 +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.64/Source/MACLib/APEInfo.h mac-sdk-5.64-gcc/Source/MACLib/APEInfo.h
--- mac-sdk-5.64/Source/MACLib/APEInfo.h	2020-09-14 12:55:01 +0000
+++ mac-sdk-5.64-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.64/Source/MACLib/MACLib.cpp mac-sdk-5.64-gcc/Source/MACLib/MACLib.cpp
--- mac-sdk-5.64/Source/MACLib/MACLib.cpp	2020-11-02 14:06:36 +0000
+++ mac-sdk-5.64-gcc/Source/MACLib/MACLib.cpp	2020-11-06 19:03:18 +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.64/Source/Projects/NonWindows/Makefile mac-sdk-5.64-gcc/Source/Projects/NonWindows/Makefile
--- mac-sdk-5.64/Source/Projects/NonWindows/Makefile	2020-04-24 21:09:10 +0000
+++ mac-sdk-5.64-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.64/Source/Shared/All.h mac-sdk-5.64-gcc/Source/Shared/All.h
--- mac-sdk-5.64/Source/Shared/All.h	2020-11-06 16:17:42 +0000
+++ mac-sdk-5.64-gcc/Source/Shared/All.h	2020-11-06 19:59:10 +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;
@@ -217,12 +188,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-5.64/Source/Shared/NoWindows.h mac-sdk-5.64-gcc/Source/Shared/NoWindows.h
--- mac-sdk-5.64/Source/Shared/NoWindows.h	2020-11-09 20:13:40 +0000
+++ mac-sdk-5.64-gcc/Source/Shared/NoWindows.h	2020-11-10 16:17:27 +0000
@@ -52,7 +52,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
@@ -60,7 +60,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.64/configure mac-sdk-5.64-gcc/configure
--- mac-sdk-5.64/configure	1970-01-01 00:00:00 +0000
+++ mac-sdk-5.64-gcc/configure	2019-11-21 21:28:57 +0000
@@ -0,0 +1 @@
+#!/bin/sh