]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/test.priv.h
ncurses 6.2 - patch 20200718
[ncurses.git] / test / test.priv.h
index b9c5dc651b0905cab2d8c8b48cc3ae0b4af70723..b352ce7d016dbebcc54b6bd943f56af9c46b5657 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.              *
+ * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 1998-2017,2018 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,7 +30,7 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
-/* $Id: test.priv.h,v 1.182 2019/04/20 20:15:39 tom Exp $ */
+/* $Id: test.priv.h,v 1.187 2020/07/11 23:01:49 tom Exp $ */
 
 #ifndef __TEST_PRIV_H
 #define __TEST_PRIV_H 1
@@ -436,6 +437,13 @@ extern int optind;
 #include <assert.h>
 #include <ctype.h>
 
+#if defined(_MSC_VER)
+#undef popen
+#define popen(s,n) _popen(s,n)
+#undef pclose
+#define pclose(s) _pclose(s)
+#endif
+
 #ifndef GCC_NORETURN
 #define GCC_NORETURN           /* nothing */
 #endif
@@ -885,9 +893,9 @@ extern int TABSIZE;
  * ncurses restores the cursor in endwin().  Other libraries may not.
  */
 #ifdef NCURSES_VERSION
-#define exit_curses() endwin()
+#define stop_curses() endwin()
 #else
-#define exit_curses() do { endwin(); curs_set(1); } while (0)
+#define stop_curses() do { endwin(); curs_set(1); } while (0)
 #endif
 
 /* ncurses implements tparm() with varargs, X/Open with a fixed-parameter list
@@ -904,7 +912,7 @@ extern int TABSIZE;
 #include <nc_alloc.h>
 #if HAVE_NC_FREEALL && defined(USE_TINFO)
 #undef ExitProgram
-#define ExitProgram(code) _nc_free_tinfo(code)
+#define ExitProgram(code) exit_terminfo(code)
 #endif
 #else
 #define typeMalloc(type,n) (type *) malloc((size_t)(n) * sizeof(type))
@@ -976,9 +984,9 @@ extern int TABSIZE;
 #endif
 
 #if !HAVE_STRSTR
-extern char * _nc_strstr (const char *, const char *);
+extern char *_nc_strstr(const char *, const char *);
 #define strstr(a,b) _nc_strstr((a),(b))
-#endif /* !HAVE_STRSTR */
+#endif /* !HAVE_STRSTR */
 
 /* Use this to quiet gcc's -Wwrite-strings warnings, but accommodate SVr4
  * curses which doesn't have const parameters declared (so far) in the places
@@ -1021,6 +1029,12 @@ extern char * _nc_strstr (const char *, const char *);
 #define InitAndCatch(init,handler) do { init; CATCHALL(handler); } while (0)
 #endif
 
+#if defined(_WIN32) || defined(USE_WIN32CON_DRIVER)
+#define SetupAlarm(opt)        (void)opt
+#else
+#define SetupAlarm(opt)        if (opt) alarm((unsigned)opt)
+#endif
+
 /*
  * Workaround for clean(er) compile with Solaris's legacy curses.
  * The same would be needed for HPUX 10.20
@@ -1129,7 +1143,7 @@ extern char *tgoto(char *, int, int);     /* available, but not prototyped */
        if ((_nc_tracing & TRACE_MAXIMUM) == 0) { \
            int t = _nc_getenv_num("NCURSES_TRACE"); \
            if (t >= 0) \
-               trace((unsigned) t); \
+               curses_trace((unsigned) t); \
        }
 extern unsigned _nc_tracing;
 extern int _nc_getenv_num(const char *);