From 9e301775ffce832647850c1103008303e64688c9 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Thu, 19 Dec 2024 17:59:57 -0800 Subject: [PATCH] intprops: Detect MSVC __typeof__ support. * lib/intprops-internal.h (_GL_HAVE___TYPEOF__): Copy condition from lib/stdbit.in.h. --- ChangeLog | 4 ++++ lib/intprops-internal.h | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59fa232bd7..4a453a39f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2024-12-19 Collin Funk + intprops: Detect MSVC __typeof__ support. + * lib/intprops-internal.h (_GL_HAVE___TYPEOF__): Copy condition from + lib/stdbit.in.h. + stdbit-h: Detect MSVC __typeof__ support. * lib/stdbit.in.h (_GL_STDBIT_TYPEOF_CAST): Use __typeof__ on Visual Studio 2022 version 17.9 and later. diff --git a/lib/intprops-internal.h b/lib/intprops-internal.h index c8cc0e2019..0b7e1f539a 100644 --- a/lib/intprops-internal.h +++ b/lib/intprops-internal.h @@ -77,10 +77,11 @@ /* Does the __typeof__ keyword work? This could be done by 'configure', but for now it's easier to do it by hand. */ -#if (2 <= __GNUC__ \ - || (4 <= __clang_major__) \ - || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ - || (0x5110 <= __SUNPRO_C && !__STDC__)) +#if ((defined __GNUC__ && 2 <= __GNUC__) \ + || (defined __clang_major__ && 4 <= __clang_major__) \ + || (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ + || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \ + || (defined _MSC_VER && 1939 <= _MSC_VER)) # define _GL_HAVE___TYPEOF__ 1 #else # define _GL_HAVE___TYPEOF__ 0 -- 2.39.5