From 314da6d6bc1f388ae1f9b3e35c40dccab912a42c Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 24 Feb 2026 15:41:11 -0600 Subject: [PATCH] wolfssl/wolfcrypt/types.h: work around limitations of Watcom and Windows preprocessors, re WC_ARG_NOT_NULL and friends. --- wolfssl/wolfcrypt/types.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 4ba6dfbe75..af7d6b6224 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -2056,7 +2056,8 @@ WOLFSSL_API word32 CheckRunTimeSettings(void); #define WC_NORETURN #endif -#if defined(__has_attribute) && __has_attribute(nonnull) +#ifdef __has_attribute +#if __has_attribute(nonnull) #ifndef WC_ARG_NOT_NULL #define WC_ARG_NOT_NULL(a) __attribute__((nonnull(a))) #endif @@ -2069,16 +2070,17 @@ WOLFSSL_API word32 CheckRunTimeSettings(void); #ifndef WC_ALL_ARGS_NOT_NULL #define WC_ALL_ARGS_NOT_NULL __attribute__((nonnull)) #endif -#else - #ifndef WC_ARG_NOT_NULL - #define WC_ARG_NOT_NULL(a) /* null expansion */ - #endif - #ifndef WC_ARGS_NOT_NULL - #define WC_ARGS_NOT_NULL(p_a) /* null expansion */ - #endif - #ifndef WC_ALL_ARGS_NOT_NULL - #define WC_ALL_ARGS_NOT_NULL - #endif +#endif /* __has_attribute(nonnull) */ +#endif /* defined(__has_attribute) */ + +#ifndef WC_ARG_NOT_NULL + #define WC_ARG_NOT_NULL(a) /* null expansion */ +#endif +#ifndef WC_ARGS_NOT_NULL + #define WC_ARGS_NOT_NULL(p_a) /* null expansion */ +#endif +#ifndef WC_ALL_ARGS_NOT_NULL + #define WC_ALL_ARGS_NOT_NULL #endif #if defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY) || \