From d050a1ce05266423aeab30f56c64737d4ca9f3e4 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周一, 16 1月 2023 17:02:31 +0800 Subject: [PATCH] Fix typos --- libscpi/inc/scpi/cc.h | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 42 insertions(+), 8 deletions(-) diff --git a/libscpi/inc/scpi/cc.h b/libscpi/inc/scpi/cc.h index d0d0a1e..2fc79c7 100644 --- a/libscpi/inc/scpi/cc.h +++ b/libscpi/inc/scpi/cc.h @@ -54,37 +54,63 @@ # endif #endif -#if POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700 +#if defined(__cplusplus) +# if (__cplusplus >= 199711) +# define CXX98 +# endif +#endif + +#if (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200809L) || \ + (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 700) #define HAVE_STRNDUP 1 #define HAVE_STRNLEN 1 #endif -#if _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || C99 +#if (defined _BSD_SOURCE && _BSD_SOURCE) || \ + (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 500) || \ + (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \ + (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) || \ + C99 #define HAVE_SNPRINTF 1 #endif -#if _POSIX_C_SOURCE >= 200112L +#if (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) #define HAVE_STRNCASECMP 1 #endif -#if _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || C99 +#if (defined _BSD_SOURCE && _BSD_SOURCE) || \ + (defined _SVID_SOURCE && _SVID_SOURCE) || \ + (defined _XOPEN_SOURCE && _XOPEN_SOURCE) || \ + (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \ + (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) ||\ + C99 #define HAVE_ISNAN 1 #endif -#if _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || C99 +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 600)|| \ + (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \ + (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) || \ + C99 #define HAVE_ISFINITE 1 #define HAVE_SIGNBIT 1 #endif -#if XOPEN_SOURCE >= 600 || _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L +#if (defined _XOPEN_SOURCE && XOPEN_SOURCE >= 600) || \ + (defined _BSD_SOURCE && _BSD_SOURCE) || \ + (defined _SVID_SOURCE && _SVID_SOURCE) || \ + (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \ + (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) #define HAVE_STRTOLL 1 #endif -#if _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || C99 +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 600) || \ + (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || \ + (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L) || \ + C99 #define HAVE_STRTOF 1 #endif -#if _ISOC99_SOURCE || C99 +#if (defined _ISOC99_SOURCE && _ISOC99_SOURCE) || C99 || CXX98 #define HAVE_STDBOOL 1 #endif @@ -130,6 +156,10 @@ #define HAVE_STRDUP 0 #endif +#ifndef HAVE_STRNDUP +#define HAVE_STRNDUP 0 +#endif + #ifndef HAVE_STRNICMP #define HAVE_STRNICMP 0 #endif @@ -170,6 +200,10 @@ #define HAVE_STRTOF 0 #endif +#ifndef HAVE_DTOSTRE +#define HAVE_DTOSTRE 0 +#endif + #ifdef __cplusplus } #endif -- Gitblit v1.9.1