From a987cf4b49ff92f4925f7106862b106a3a3ac514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Fri, 22 Mar 2024 14:52:39 -0400 Subject: [PATCH] Stop interlacing preprocessor stuff. --- src/xpdev/gen_defs.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/xpdev/gen_defs.h b/src/xpdev/gen_defs.h index b2729b5afc..261fa9b564 100644 --- a/src/xpdev/gen_defs.h +++ b/src/xpdev/gen_defs.h @@ -430,11 +430,9 @@ typedef struct { #define TERMINATE(str) str[sizeof(str)-1]=0 /* This is a bound-safe version of strcpy basically - only works with fixed-length arrays */ -#ifdef _DEBUG +#if defined(_DEBUG) && (__STDC_VERSION__ >= 201112L) #define SAFECOPY(dst,src) do { \ -#if (__STDC_VERSION__ >= 201112L) static_assert(sizeof(dst) != sizeof(void*), "SAFECOPY() on pointer-sized dst, use strlcpy"); \ -#endif strlcpy(dst,src,sizeof(dst)); \ } while(0) #else @@ -442,11 +440,9 @@ typedef struct { #endif /* Extra-safe SAFECOPY doesn't pass NULL-pointer to strlcpy */ -#ifdef _DEBUG +#if defined(_DEBUG) && (__STDC_VERSION__ >= 201112L) #define XSAFECOPY(dst,src) do { \ -#if (__STDC_VERSION__ >= 201112L) static_assert(sizeof(dst) != sizeof(void*), "SAFECOPY() on pointer-sized dst, use strlcpy"); \ -#endif strlcpy(dst,(src)==NULL?"(null)":(src),sizeof(dst)); \ } while(0) #else -- GitLab