aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-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);