Reorder ifdefs to prevent redefinition of wint_t problems in NetBSD.
authorDavid Griffith <dave@661.org>
Tue, 23 Jul 2019 06:55:06 +0000 (23:55 -0700)
committerDavid Griffith <dave@661.org>
Tue, 23 Jul 2019 06:55:06 +0000 (23:55 -0700)
src/curses/ux_input.c

index 5814427929a1767373410b64cf979f06bb44f3b6..90ae50854f1e426d8180cf363608e2bd46cb585e 100644 (file)
 #include <sys/time.h>
 #include <sys/select.h>
 
-#ifdef USE_UTF8
-#include <wchar.h>
-#else
-#ifndef wint_t
-typedef unsigned int wint_t;
-#endif
-#endif
-
 #ifdef USE_NCURSES_H
 #include <ncurses.h>
 #else
 #include <curses.h>
 #endif
 
+#include "ux_frotz.h"
+
+#ifdef USE_UTF8
+#include <wctype.h>
+#endif
+
 #ifndef NO_SOUND
 #include "ux_sema.h"
 ux_sem_t sound_done;
 #endif
 
-#include "ux_frotz.h"
-
 static int start_of_prev_word(int, const zchar*);
 static int end_of_next_word(int, const zchar*, int);
 
@@ -178,7 +174,11 @@ void os_tick()
 
 static int unix_read_char(int extkeys)
 {
+#ifdef USE_UTF8
     wint_t c;
+#else
+    int c;
+#endif
     int sel, fd = fileno(stdin);
     fd_set rsel;
     struct timeval tval, *t_left, maxwait;