diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-03-02 21:28:08 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-03-02 21:28:08 +0100 |
commit | c2bea7ec74b8f957e56a14a55aa7aa07e7dd3118 (patch) | |
tree | c0895195df69fad9d735deb58e41133ee633fef4 | |
parent | fb0cdfe743869f6592090e441a071f0904a80634 (diff) |
Conditional-compile the POSIX-specific stuff
-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); |