From ca212251267129fff22eeeb5b1af61af167c4ffe Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Mon, 16 Feb 2009 20:56:57 +0000 Subject: [PATCH] cross-platformness for signals git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@635 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Makefile.dep | 12 +++++------- init.c | 23 ++++++++++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Makefile.dep b/Makefile.dep index 91688a2e..36c6b537 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -1,5 +1,6 @@ $(OBJDIR)/aide.o: aide.c const.h struct.h global.h divers.h graph.h moteur.h \ - tables_aide.h aide.h sdlscreen.h texte.h clavier.h windows.h input.h + tables_aide.h aide.h sdlscreen.h texte.h clavier.h windows.h input.h \ + hotkeys.h erreurs.h $(OBJDIR)/boutons.o: boutons.c const.h struct.h global.h divers.h graph.h moteur.h \ readline.h files.h loadsave.h init.h boutons.h operatio.h pages.h \ erreurs.h readini.h saveini.h shade.h io.h aide.h texte.h sdlscreen.h \ @@ -14,12 +15,10 @@ $(OBJDIR)/files.o: files.c const.h struct.h global.h graph.h divers.h erreurs.h io.h windows.h loadsave.h $(OBJDIR)/gfxcfg.o: gfxcfg.c SFont.h struct.h const.h clavier.h io.h hotkeys.h \ setup.h -$(OBJDIR)/graph.o: graph.c global.h struct.h const.h moteur.h boutons.h pages.h \ - erreurs.h sdlscreen.h graph.h divers.h pxsimple.h pxtall.h pxwide.h \ - windows.h +$(OBJDIR)/hotkeys.o: hotkeys.c struct.h const.h global.h hotkeys.h $(OBJDIR)/init.o: init.c const.h struct.h global.h graph.h boutons.h palette.h \ aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h files.h \ - setup.h windows.h sdlscreen.h mountlist.h + setup.h windows.h sdlscreen.h mountlist.h loadsave.h $(OBJDIR)/input.o: input.c global.h struct.h const.h clavier.h graph.h sdlscreen.h \ windows.h erreurs.h divers.h input.h $(OBJDIR)/io.o: io.c struct.h const.h io.h @@ -45,10 +44,9 @@ $(OBJDIR)/pxsimple.o: pxsimple.c global.h struct.h const.h sdlscreen.h divers.h $(OBJDIR)/pxtall.o: pxtall.c global.h struct.h const.h sdlscreen.h divers.h \ pxsimple.h $(OBJDIR)/pxwide.o: pxwide.c global.h struct.h const.h sdlscreen.h divers.h -$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h divers.h $(OBJDIR)/readini.o: readini.c const.h global.h struct.h graph.h windows.h divers.h $(OBJDIR)/readline.o: readline.c const.h struct.h global.h graph.h divers.h \ - erreurs.h sdlscreen.h readline.h windows.h + erreurs.h sdlscreen.h readline.h windows.h input.h $(OBJDIR)/realpath.o: realpath.c $(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h erreurs.h \ graph.h divers.h diff --git a/init.c b/init.c index b1d315b7..46264b68 100644 --- a/init.c +++ b/init.c @@ -47,12 +47,13 @@ #endif #ifdef GRAFX2_CATCHES_SIGNALS #include -#endif - -#if defined(__macosx__) - #define __p_sig_fn_t sig_t -#elif defined(__linux__) - #define __p_sig_fn_t sighandler_t + #if defined(__WIN32__) + #define SIGHANDLER_T __p_sig_fn_t + #elif defined(__macosx__) + #define SIGHANDLER_T sig_t + #else + #define SIGHANDLER_T __sighandler_t + #endif #endif #include "const.h" @@ -2381,11 +2382,11 @@ void Config_par_defaut(void) #ifdef GRAFX2_CATCHES_SIGNALS // Memorize the signal handlers of SDL -__p_sig_fn_t Handler_TERM=SIG_DFL; -__p_sig_fn_t Handler_INT=SIG_DFL; -__p_sig_fn_t Handler_ABRT=SIG_DFL; -__p_sig_fn_t Handler_SEGV=SIG_DFL; -__p_sig_fn_t Handler_FPE=SIG_DFL; +SIGHANDLER_T Handler_TERM=SIG_DFL; +SIGHANDLER_T Handler_INT=SIG_DFL; +SIGHANDLER_T Handler_ABRT=SIG_DFL; +SIGHANDLER_T Handler_SEGV=SIG_DFL; +SIGHANDLER_T Handler_FPE=SIG_DFL; void sig_handler(int sig) {