From 4021a61afaa9a8483f2775e8bc859aa2a2e454a0 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 31 Jul 2025 01:32:32 +0300
Subject: [PATCH] mac: replace @autoreleasepool use with NSAutoreleasePool
Better gcc comatibility this way.
asm output from clang-8 is identical.
---
src/sdl2_compat_objc.m | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/sdl2_compat_objc.m b/src/sdl2_compat_objc.m
index 9f6737d9..05873687 100644
--- a/src/sdl2_compat_objc.m
+++ b/src/sdl2_compat_objc.m
@@ -36,7 +36,7 @@
SDL2_PRIVATE void SDL2Compat_NSLog(const char *prefix, const char *text)
{
- @autoreleasepool {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; {
NSString *nsText = [NSString stringWithUTF8String:text];
if (prefix && *prefix) {
NSString *nsPrefix = [NSString stringWithUTF8String:prefix];
@@ -45,6 +45,7 @@ SDL2_PRIVATE void SDL2Compat_NSLog(const char *prefix, const char *text)
NSLog(@"%@", nsText);
}
}
+ [pool drain];
}
SDL2_PRIVATE void error_dialog(const char *errorMsg)