From 53a9c705e7df4e8a5e35be325bcd939c59d64e04 Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Thu, 7 Dec 2023 08:23:01 +0800 Subject: [PATCH] Address the support of typeof operator As of C23, typeof is now included as part of the C standard. --- src/common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common.h b/src/common.h index eb65952d..b4c2ab98 100644 --- a/src/common.h +++ b/src/common.h @@ -109,7 +109,10 @@ */ #define COUNT_VARARGS(...) _GET_NTH_ARG("ignored", ##__VA_ARGS__, 4, 3, 2, 1, 0) -#if defined(__GNUC__) || defined(__clang__) +/* As of C23, typeof is now included as part of the C standard. */ +#if defined(__GNUC__) || defined(__clang__) || \ + (defined(__STDC__) && defined(__STDC_VERSION__) && \ + (__STDC_VERSION__ >= 202000L)) /* C2x/C23 ?*/ #define __HAVE_TYPEOF 1 #endif