diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-11-09 20:49:54 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-11-09 20:49:54 +0000 |
| commit | 4d55a8b8254dff61fdc7b1959f6aef7eafbd9439 (patch) | |
| tree | fb5e56131a7c8b729641c70e7a87883ebaea5186 /macosx/main.m | |
| parent | 71d6c56271e2650b1a2f5149521a5b1896084710 (diff) | |
| download | pcsxr-4d55a8b8254dff61fdc7b1959f6aef7eafbd9439.tar.gz | |
Patch 10767 (Durandal_1707).
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72138 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/main.m')
| -rw-r--r-- | macosx/main.m | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/macosx/main.m b/macosx/main.m index a8f73b9d..7c730e0c 100644 --- a/macosx/main.m +++ b/macosx/main.m @@ -79,7 +79,7 @@ int SysInit() { LoadMcds(Config.Mcd1, Config.Mcd2); #ifdef USE_POWER_ASSERTION - IOReturn success= IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &powerAssertion); + IOReturn success= IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("SysInit()"), &powerAssertion); if (success != kIOReturnSuccess) { NSLog(@"Unable to stop sleep, error code %d", success); } @@ -110,21 +110,21 @@ void SysPrintf(const char *fmt, ...) { void SysMessage(const char *fmt, ...) { va_list list; - char msg[512]; - NSString *locFmtString = NSLocalizedString([NSString stringWithCString:fmt], nil); + NSString *locFmtString = NSLocalizedString([NSString stringWithCString:fmt encoding:NSUTF8StringEncoding], nil); va_start(list, fmt); - vsprintf(msg, [locFmtString lossyCString], list); + NSString *msg = [[NSString alloc] initWithFormat:locFmtString arguments:list]; va_end(list); - - NSRunAlertPanel(NSLocalizedString(@"Error!", nil), - [NSString stringWithCString:msg], - nil, nil, nil); + + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:msg forKey:NSLocalizedFailureReasonErrorKey]; + [NSApp presentError:[NSError errorWithDomain:@"Unknown Domain" code:-1 userInfo:userInfo]]; + + [msg release]; } void *SysLoadLibrary(const char *lib) { - NSBundle *bundle = [NSBundle bundleWithPath:[NSString stringWithCString:lib]]; + NSBundle *bundle = [NSBundle bundleWithPath:[[NSFileManager defaultManager] stringWithFileSystemRepresentation:lib length:strlen(lib)]]; if (bundle != nil) { return dlopen([[bundle executablePath] fileSystemRepresentation], RTLD_LAZY /*RTLD_NOW*/); } |
