| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Sorry for totally off-base post about exceptions being broken in gcc. A
few people have already explained my errors off the list, so I reckon I
should post to tell folks to just ignore what I wrote, it's wrong.
Clearly I need to brush up my understanding of exceptions, but what I was
thinking of were structured exceptions in Windows. Someone told me that
this is actually an issue of signals, not exceptions. These are very
nice, and I guess I'm just not sure if there's something equivalent
available in Mac OS X with gcc. For example, with structured exceptions,
you can do something like this:
__try
{
// do something crazy here
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
DWORD ecode = GetExceptionCode();
if (ecode == EXCEPTION_ACCESS_VIOLATION)
printf("illegit pointer access!\n");
else if (ecode == EXCEPTION_INT_DIVIDE_BY_ZERO)
printf("illegit division by zero!\n");
etc...
}
Or do whatever you want, but basically, it allows you to catch something
and your process doesn't get killed. For my purposes, I am working on
software that hosts plugins, and I'd like to be able to wrap any calls to
the plugin with this sort of thing so that, if the plugin misbehaves, I
can inform the user about this, but not kill the host's process.
So, I'm probably getting far off topic now, but if anyone knows how I
could do something equivalent to Windows structured exceptions in Mac OS
X, I'd love to hear... :)
Marc
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.