]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/dots_termcap.c
ncurses 6.0 - patch 20151017
[ncurses.git] / test / dots_termcap.c
index 9a8d24b396c211d6522a08c26cbd663e264ce8ba..9918e368c564ca059fc923a72f0bf4ab01e7e007 100644 (file)
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_termcap.c,v 1.5 2013/06/09 00:09:46 tom Exp $
+ * $Id: dots_termcap.c,v 1.8 2014/09/25 09:00:56 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
 #define USE_TINFO
 #include <test.priv.h>
 
+#if !defined(__MINGW32__)
+#include <sys/time.h>
+#endif
+
 #if HAVE_TGETENT
 
 #include <time.h>
@@ -101,7 +105,7 @@ TPUTS_PROTO(outc, c)
 
     if (interrupted) {
        char tmp = (char) c;
-       if (write(STDOUT_FILENO, &tmp, 1) == -1)
+       if (write(STDOUT_FILENO, &tmp, (size_t) 1) == -1)
            rc = EOF;
     } else {
        rc = putc(c, stdout);
@@ -149,8 +153,8 @@ ranf(void)
 static void
 my_napms(int ms)
 {
-#if defined(__MINGW32__)
-    Sleep(ms);
+#if defined(__MINGW32__) || !HAVE_GETTIMEOFDAY
+    Sleep((DWORD) ms);
 #else
     struct timeval data;
     data.tv_sec = 0;