diff options
-rw-r--r-- | main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -8,11 +8,14 @@ #include <tuple> #include <cctype> #include <cassert> -#include <signal.h> #include <sys/time.h> #include "params.h" #include "world.h" +#ifndef _WIN32 +# include <signal.h> +#endif + using namespace std; @@ -213,12 +216,14 @@ string preprocess(istream &file){ static ScreenBuffer *sb; +#ifndef _WIN32 static void signalHandler(int sig){ if(sig==SIGINT){ sb->emergencyDeinit(); _exit(130); } } +#endif int main(int argc,char **argv){ @@ -261,7 +266,9 @@ int main(int argc,char **argv){ } sb=new ScreenBuffer(SIZE*3,SIZE); +#ifndef _WIN32 signal(SIGINT,signalHandler); +#endif world.print(*sb); for(int i=0;i<C::autoTimeout;i++){ usleep(3000); |