Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -59,12 +59,15 @@ * signal-safe operations like setting a variable or calling a * signal-safe function! */ - (void)applicationDidReceiveSIGINT; +#ifndef _WIN32 /** * \brief A method which is called when the application received a SIGHUP. + * + * This signal is not available on Windows. * * \warning You are not allowed to send any messages inside this method, as * message dispatching is not signal-safe! You are only allowed to do * signal-safe operations like setting a variable or calling a * signal-safe function! @@ -71,10 +74,12 @@ */ - (void)applicationDidReceiveSIGHUP; /** * \brief A method which is called when the application received a SIGUSR1. + * + * This signal is not available on Windows. * * \warning You are not allowed to send any messages inside this method, as * message dispatching is not signal-safe! You are only allowed to do * signal-safe operations like setting a variable or calling a * signal-safe function! @@ -81,17 +86,20 @@ */ - (void)applicationDidReceiveSIGUSR1; /** * \brief A method which is called when the application received a SIGUSR2. + * + * This signal is not available on Windows. * * \warning You are not allowed to send any messages inside this method, as * message dispatching is not signal-safe! You are only allowed to do * signal-safe operations like setting a variable or calling a * signal-safe function! */ - (void)applicationDidReceiveSIGUSR2; +#endif @end /** * \brief Represents the application as an object. */ @@ -103,13 +111,15 @@ int *argc; char ***argv; @public id delegate; void (*SIGINTHandler)(id, SEL); +#ifndef _WIN32 void (*SIGHUPHandler)(id, SEL); void (*SIGUSR1Handler)(id, SEL); void (*SIGUSR2Handler)(id, SEL); +#endif } #ifdef OF_HAVE_PROPERTIES @property (readonly, assign) OFString *programName; @property (readonly, assign) OFArray *arguments; Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -19,13 +19,11 @@ #define OF_APPLICATION_M #include #include -#ifndef _WIN32 -# include -#endif +#include #import "OFApplication.h" #import "OFString.h" #import "OFArray.h" #import "OFDictionary.h" @@ -57,13 +55,15 @@ { \ app->sig##Handler(app->delegate, \ @selector(applicationDidReceive##sig)); \ } SIGNAL_HANDLER(SIGINT) +#ifndef _WIN32 SIGNAL_HANDLER(SIGHUP) SIGNAL_HANDLER(SIGUSR1) SIGNAL_HANDLER(SIGUSR2) +#endif #undef SIGNAL_HANDLER int of_application_main(int *argc, char **argv[], Class cls) { @@ -262,13 +262,15 @@ @selector(applicationDidReceive##sig)]) \ signal(sig, handle##sig); \ else \ signal(sig, SIG_DFL); REGISTER_SIGNAL(SIGINT) +#ifndef _WIN32 REGISTER_SIGNAL(SIGHUP) REGISTER_SIGNAL(SIGUSR1) REGISTER_SIGNAL(SIGUSR2) +#endif #undef REGISTER_SIGNAL } - (void)run {