From b421e5a96b48aa1c44a0ebba301e5be8d4fc8359 Mon Sep 17 00:00:00 2001 From: Erick Date: Sat, 5 Feb 2022 01:52:03 +0100 Subject: [PATCH] move handle in windows only declaration into #ifndef directive --- tyvm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tyvm.c b/tyvm.c index 919053f..5be6d10 100644 --- a/tyvm.c +++ b/tyvm.c @@ -29,10 +29,14 @@ #include #endif +#ifndef __UNIX + /* windows only declaration */ + HANDLE hStdin = INVALID_HANDLE_VALUE; +#endif + #define TRUE 1 #define FALSE 0 -HANDLE hStdin = INVALID_HANDLE_VALUE; /* memory mapped register tables */ enum mmr { @@ -148,7 +152,6 @@ int read_image(const char* image_path) { return 1; } - #ifdef __UNIX uint16_t check_key() { fd_set readfds; @@ -221,9 +224,8 @@ void mem_read(uint16_t address) { #endif -/* main loop */ -int main(int argc, const char* argv[]) { +int main(int argc, const char* argv[]) { if(argc < 2) { printf("usage: [image-file1] ...\n"); exit(2);