diff --git a/include/input.h b/include/input.h index fcb9e6f..d73a36a 100644 --- a/include/input.h +++ b/include/input.h @@ -9,6 +9,10 @@ typedef struct input_args_t bool *alive; } InputArgs; +#ifdef _WIN32 +void input(void *vargp); +#else void *input(void *vargp); +#endif #endif /* __INPUT_H__ */ diff --git a/src/input.c b/src/input.c index 192d566..f970dfb 100644 --- a/src/input.c +++ b/src/input.c @@ -30,7 +30,11 @@ int getch(void) } #endif +#ifdef _WIN32 +void input(void *vargp) +#else void *input(void *vargp) +#endif { int *out = ((InputArgs *)vargp)->out; bool *alive = ((InputArgs *)vargp)->alive; @@ -39,5 +43,7 @@ void *input(void *vargp) { *out = getch(); } +#ifndef _WIN32 return NULL; +#endif } diff --git a/src/main.c b/src/main.c index 52a2a30..f772ae6 100644 --- a/src/main.c +++ b/src/main.c @@ -47,10 +47,9 @@ void resetCoordinates(void) int main(int argc, char **argv) { - srand(time(NULL)); + srand((unsigned int)time(NULL)); Player *player = playerCreate(DOWN, DEFX, DEFY, 0); Screen *screen = screenCreate(SIZE, SIZE, ' '); - PlayerNode *node; int i; int head_x, head_y; Food food = generateFood(player);