From c2bea7ec74b8f957e56a14a55aa7aa07e7dd3118 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Thu, 2 Mar 2017 21:28:08 +0100 Subject: Conditional-compile the POSIX-specific stuff --- main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index d75c253..0412487 100644 --- a/main.cpp +++ b/main.cpp @@ -8,11 +8,14 @@ #include #include #include -#include #include #include "params.h" #include "world.h" +#ifndef _WIN32 +# include +#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