Allow the Breakpad Mac framework to be built without -fexceptions.

Review URL: http://breakpad.appspot.com/34003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@417 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
mmentovai 2009-10-15 22:42:54 +00:00
parent cb33b20f75
commit a3043159f3

View file

@ -747,9 +747,7 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
// Create a mutex for use in accessing the SimpleStringDictionary
int mutexResult = pthread_mutex_init(&gDictionaryMutex, NULL);
if (mutexResult != 0) {
throw mutexResult; // caught down below
}
if (mutexResult == 0) {
// With the current compiler, gBreakpadAllocator is allocating 1444 bytes.
// Let's round up to the nearest page size.
@ -775,23 +773,20 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
gMasterAllocator->Protect();
gKeyValueAllocator->Protect();
gBreakpadAllocator->Protect();
} else {
[pool release];
#ifdef __EXCEPTIONS
throw(-1);
#else
return NULL;
#endif
}
// Can uncomment this line to figure out how much space was actually
// allocated using this allocator
// printf("gBreakpadAllocator allocated size = %d\n",
// gBreakpadAllocator->GetAllocatedSize() );
[pool release];
return (BreakpadRef)breakpad;
}
[pool release];
}
} catch(...) { // don't let exceptions leave this C API
fprintf(stderr, "BreakpadCreate() : error\n");
}
if (gKeyValueAllocator) {
gKeyValueAllocator->~ProtectedMemoryAllocator();
gKeyValueAllocator = NULL;
@ -804,7 +799,6 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
delete gMasterAllocator;
gMasterAllocator = NULL;
}
return NULL;
}