blindfix for Visual : minor casting issue

should not happen since SIGIGN is provided by <signal.h>,
so it should work "ouf of the box"
This commit is contained in:
Yann Collet 2017-10-01 15:32:48 -07:00
parent 00fc1ba8dd
commit bd18095edc

View File

@ -145,13 +145,15 @@ static clock_t g_time = 0;
**************************************/ **************************************/
#include <signal.h> #include <signal.h>
typedef void (*signalHandler_f) (int);
const char* g_artefact = NULL; const char* g_artefact = NULL;
void INThandler(int sig) void INThandler(int sig)
{ {
signal(sig, SIG_IGN); assert(sig==SIGINT);
remove(g_artefact); signal(sig, (signalHandler_f)SIG_IGN); /* cast required to circumvent a bug in Visual Studio 2008 */
if (g_artefact) remove(g_artefact);
DISPLAY("\n"); DISPLAY("\n");
exit(1); exit(2);
} }