From 28c1a7192150a3dd46f7e5ef0e4fa2320c903ad3 Mon Sep 17 00:00:00 2001 From: Sam Bingner Date: Wed, 27 May 2020 22:46:55 -1000 Subject: Kill the gssc library output problem once and for all --- gssc.mm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gssc.mm b/gssc.mm index e4fb37e..8cbebb1 100644 --- a/gssc.mm +++ b/gssc.mm @@ -74,6 +74,12 @@ void OnGSCapabilityChanged( int main(int argc, char *argv[]) { dlopen("/System/Library/Frameworks/Foundation.framework/Foundation", RTLD_GLOBAL | RTLD_LAZY); dlopen("/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices", RTLD_GLOBAL | RTLD_LAZY); + if (getenv("OS_ACTIVITY_DT_MODE")) { + // This would make a bunch of random NSLogs print + unsetenv("OS_ACTIVITY_DT_MODE"); + execvp(argv[0], argv); + exit(1); + } NSAutoreleasePool *pool = [[objc_getClass("NSAutoreleasePool") alloc] init]; @@ -723,7 +729,11 @@ int main(int argc, char *argv[]) { } if (capability != nil) { - printf("%s\n", capability == nil ? "(null)" : [[capability description] UTF8String]); + if ([capability isKindOfClass:[NSString class]]) { + printf("%s\n", [(NSString*)capability UTF8String]); + } else { + printf("%s\n", capability == nil ? "(null)" : [[capability description] UTF8String]); + } break; } -- cgit v1.2.3