As we are on the cocoa list, I assume you are using obj-c.
If you are using plain C API in your code, you should not have problem.
But if "// do stuff" contains some obj-c calls that can raise an
exception, you have to make sure to catch it.
void DisplayReconfigurationCallBack (CGDirectDispla
What exactly would I put in here?
It calls into my code with
void DisplayReconfigurationCallBack (CGDirectDisplayID display,
CGDisplayChangeSummaryFlags flags, void *userInfo)
{
if (flags & kCGDisplayAddFlag)
{
// do stuff
}
else if (flags & kCGDisplayRemoveFlag)
{
It does not say to not use longjmp, it sais to not use longjmp to jump
outside this function.
Just encapsulate your code in a @try / @catch() block to ensure that
even if an exception occurs (@throw use longjmp in the 32 bits
runtime), it will jump in your catch block and not outside you
> void MyDisplayReconfigurationCallBack (
>CGDirectDisplayID display,
>CGDisplayChangeSummaryFlags flags,
>void *userInfo
> );
>
> Your callback function should avoid attempting to change display
> configurations, and should not raise exceptions or perform a non-local return
> such as