From 8695b765f6bd280230f6b00c657dd61059edc54d Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周三, 01 2月 2023 17:40:32 +0800 Subject: [PATCH] coverage: fix build with c++ --- libscpi/inc/scpi/cc.h | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libscpi/inc/scpi/cc.h b/libscpi/inc/scpi/cc.h index 2563039..3487ed1 100644 --- a/libscpi/inc/scpi/cc.h +++ b/libscpi/inc/scpi/cc.h @@ -54,6 +54,12 @@ # endif #endif +#if defined(__cplusplus) +# if (__cplusplus >= 199711) +# define CXX98 1 +# endif +#endif + #if (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200809L) || \ (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 700) #define HAVE_STRNDUP 1 @@ -68,7 +74,7 @@ #define HAVE_SNPRINTF 1 #endif -#if (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) +#if (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) #define HAVE_STRNCASECMP 1 #endif @@ -104,7 +110,7 @@ #define HAVE_STRTOF 1 #endif -#if (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || C99 +#if (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || C99 || CXX98 #define HAVE_STDBOOL 1 #endif @@ -195,7 +201,7 @@ #endif #ifndef HAVE_DTOSTRE -#define HAVE_DTOSTRE 0 +#define HAVE_DTOSTRE 0 #endif #ifdef __cplusplus -- Gitblit v1.9.1