mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 15:25:01 +00:00
Check for standard C++ (>= 98), where native bool should exist, and use
that; otherwise (pre-/non-standard C++) fall back to the old behavior. Satisfies clang, hopefully doesn't mess anything else up.
This commit is contained in:
16
curses.h
16
curses.h
@@ -28,7 +28,7 @@ Defined by this header:
|
||||
**man-end****************************************************************/
|
||||
|
||||
#define PDCURSES 1 /* PDCurses-only routines */
|
||||
#define PDC_BUILD 3801
|
||||
#define PDC_BUILD 3802
|
||||
#define PDC_VER_MAJOR 3
|
||||
#define PDC_VER_MINOR 8
|
||||
#define PDC_VERDOT "3.8"
|
||||
@@ -38,6 +38,10 @@ Defined by this header:
|
||||
# define PDC_99 1
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 199711L
|
||||
# define PDC_PP98 1
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include <stdarg.h>
|
||||
@@ -55,7 +59,9 @@ Defined by this header:
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
# define bool _bool
|
||||
# ifndef PDC_PP98
|
||||
# define bool _bool
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
@@ -76,7 +82,7 @@ extern "C"
|
||||
#undef OK
|
||||
#define OK 0
|
||||
|
||||
#ifndef __bool_true_false_are_defined
|
||||
#if !defined(PDC_PP98) && !defined(__bool_true_false_are_defined)
|
||||
typedef unsigned char bool;
|
||||
#endif
|
||||
|
||||
@@ -1368,7 +1374,9 @@ PDCEX int sb_refresh(void);
|
||||
#define PDC_KEY_MODIFIER_NUMLOCK 8
|
||||
|
||||
#ifdef __cplusplus
|
||||
# undef bool
|
||||
# ifndef PDC_PP98
|
||||
# undef bool
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user