aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-03-02 21:28:08 +0100
committertomsmeding <tom.smeding@gmail.com>2017-03-02 21:28:08 +0100
commitc2bea7ec74b8f957e56a14a55aa7aa07e7dd3118 (patch)
treec0895195df69fad9d735deb58e41133ee633fef4
parentfb0cdfe743869f6592090e441a071f0904a80634 (diff)
Conditional-compile the POSIX-specific stuff
-rw-r--r--main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index d75c253..0412487 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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);