X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Ftest.priv.h;h=6f699af7a69873de257985276e63bd269d4056b8;hp=6913b25d14ca758e90660cbc49d6ecdfbc2d87e3;hb=e6bb3226cdd35f5fd9f45bb1685cc2203c889480;hpb=d6c65d287166c3105ece4a5e3f3ec7af5a5f26a3 diff --git a/test/test.priv.h b/test/test.priv.h index 6913b25d..6f699af7 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 Thomas E. Dickey * * Copyright 1998-2017,2018 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -30,7 +30,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.191 2020/09/12 23:54:42 tom Exp $ */ +/* $Id: test.priv.h,v 1.198 2021/12/18 18:55:10 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -243,6 +243,10 @@ #define HAVE_STDINT_H 0 #endif +#ifndef HAVE_STDNORETURN_H +#define HAVE_STDNORETURN_H 0 +#endif + #ifndef HAVE_STRSTR #define HAVE_STRSTR 0 #endif @@ -391,6 +395,12 @@ #include #endif +#if HAVE_STDNORETURN_H && !defined(NCURSES_VERSION) +#include +#undef GCC_NORETURN +#define GCC_NORETURN _Noreturn +#endif + #if !(defined(NCURSES_WGETCH_EVENTS) && defined(NEED_KEY_EVENT)) #undef KEY_EVENT /* reduce compiler-warnings with Visual C++ */ #endif @@ -738,10 +748,10 @@ extern "C" { #endif #if USE_STRING_HACKS && HAVE_SNPRINTF -#define _nc_SPRINTF NCURSES_VOID snprintf +#define _nc_SPRINTF NCURSES_VOID (snprintf) #define _nc_SLIMIT(n) NCURSES_CAST(size_t,n), #else -#define _nc_SPRINTF NCURSES_VOID sprintf +#define _nc_SPRINTF NCURSES_VOID (sprintf) #define _nc_SLIMIT(n) /* nothing */ #endif @@ -914,11 +924,14 @@ extern int TABSIZE; #if defined(NCURSES_VERSION) && HAVE_NC_ALLOC_H #include -#if HAVE_EXIT_TERMINFO && defined(USE_TINFO) +#if HAVE_EXIT_TERMINFO && (defined(USE_TERMINFO) || defined(USE_TINFO)) #undef ExitProgram #define ExitProgram(code) exit_terminfo(code) +#elif HAVE_EXIT_CURSES +#undef ExitProgram +#define ExitProgram(code) exit_curses(code) #endif -#else +#else /* not ncurses-tree */ #define typeMalloc(type,n) (type *) malloc((size_t)(n) * sizeof(type)) #define typeCalloc(type,elts) (type *) calloc((size_t)(elts), sizeof(type)) #define typeRealloc(type,n,p) (type *) realloc(p, (size_t)(n) * sizeof(type)) @@ -1135,6 +1148,14 @@ extern char *tgoto(char *, int, int); /* available, but not prototyped */ #define CONST_MENUS /* nothing */ #endif +#if defined(NCURSES_CONST) +#define CONST_FMT NCURSES_CONST +#elif defined(PDCURSES) +#define CONST_FMT const +#else +#define CONST_FMT /* nothing */ +#endif + /* * Simplify setting up demo of threading with these macros. */