]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/dots_termcap.c
ncurses 5.9 - patch 20140816
[ncurses.git] / test / dots_termcap.c
index 9a8d24b396c211d6522a08c26cbd663e264ce8ba..4c1d62d9f9ff3af39efae6d875a512777dc94987 100644 (file)
 /*
  * Author: Thomas E. Dickey
  *
 /*
  * 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.7 2013/09/28 21:50:35 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
 #define USE_TINFO
 #include <test.priv.h>
 
  *
  * 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>
 #if HAVE_TGETENT
 
 #include <time.h>
@@ -101,7 +105,7 @@ TPUTS_PROTO(outc, c)
 
     if (interrupted) {
        char tmp = (char) 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);
            rc = EOF;
     } else {
        rc = putc(c, stdout);
@@ -149,7 +153,7 @@ ranf(void)
 static void
 my_napms(int ms)
 {
 static void
 my_napms(int ms)
 {
-#if defined(__MINGW32__)
+#if defined(__MINGW32__) || !HAVE_GETTIMEOFDAY
     Sleep(ms);
 #else
     struct timeval data;
     Sleep(ms);
 #else
     struct timeval data;