]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/test.priv.h
ncurses 6.4 - patch 20231209
[ncurses.git] / test / test.priv.h
index a572b5c25bc0610bca3dec8e57081144646b93d5..7b18557d2e6ca3ae6ac4e742af8ee152aa8ce9ae 100644 (file)
@@ -30,7 +30,7 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
-/* $Id: test.priv.h,v 1.210 2023/02/25 21:26:04 tom Exp $ */
+/* $Id: test.priv.h,v 1.217 2023/11/11 00:23:26 tom Exp $ */
 
 #ifndef __TEST_PRIV_H
 #define __TEST_PRIV_H 1
 #define HAVE_TIGETSTR 0
 #endif
 
+#ifndef HAVE_TIPARM
+#define HAVE_TIPARM 0
+#endif
+
+#ifndef HAVE_TIPARM_S
+#define HAVE_TIPARM_S 0
+#endif
+
+#ifndef HAVE_TISCAN_S
+#define HAVE_TISCAN_S 0
+#endif
+
 #ifndef HAVE_TPUTS_SP
 #define HAVE_TPUTS_SP 0
 #endif
 #define NO_LEAKS 0
 #endif
 
+#ifndef HAVE__NC_TPARM_ANALYZE
+#define HAVE__NC_TPARM_ANALYZE 0
+#endif
+
 /*
  * Workaround for HPUX
  */
@@ -471,6 +487,13 @@ extern int optind;
 #include <assert.h>
 #include <ctype.h>
 
+#if HAVE_STDINT_H
+#include <stdint.h>
+#define my_intptr_t    intptr_t
+#else
+#define my_intptr_t    long
+#endif
+
 #if defined(_MSC_VER)
 #undef popen
 #define popen(s,n) _popen(s,n)
@@ -742,14 +765,11 @@ extern int optind;
 #define VERSION_COMMON() \
 static char *version_common(char **argv) { \
        char *base = argv[0]; \
-       char *leaf = strrchr(base, '/'); \
+       char *part = strrchr(base, '/'); \
        char *result = malloc(strlen(base) + 80); \
-       if (result == NULL) { \
-           static char unknown[] = "?"; \
-           result = unknown; \
-       } else { \
-           if (leaf++ == NULL) leaf = base; \
-           sprintf(result, "%.20s: ", leaf); \
+       if (result != NULL) { \
+           if (part++ == NULL) part = base; \
+           sprintf(result, "%.20s: ", part); \
            format_version(result + strlen(result)); \
        } \
        return result; \
@@ -995,7 +1015,9 @@ extern int TABSIZE;
 
 #define UChar(c)    ((unsigned char)(c))
 
+#ifndef SIZEOF
 #define SIZEOF(table)  (sizeof(table)/sizeof(table[0]))
+#endif
 
 #if defined(NCURSES_VERSION) && HAVE_NC_ALLOC_H
 #include <nc_alloc.h>