From: Collin Funk Date: Fri, 20 Dec 2024 01:53:48 +0000 (-0800) Subject: stdbit-h: Detect MSVC __typeof__ support. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=1a9d52aadabd3862168da43926ab4518bd7ae02f;p=gnulib.git 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/ChangeLog b/ChangeLog index cf98e92c62..59fa232bd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-12-19 Collin Funk + + 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. + 2024-12-18 Pádraig Brady crc-x86_64: fix build failure due to indentation diff --git a/lib/stdbit.in.h b/lib/stdbit.in.h index 20b9f4f466..91d237d7ad 100644 --- a/lib/stdbit.in.h +++ b/lib/stdbit.in.h @@ -77,7 +77,8 @@ _GL_INLINE_HEADER_BEGIN #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 __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \ + || (defined _MSC_VER && 1939 <= _MSC_VER)) # define _GL_STDBIT_TYPEOF_CAST(a, b) ((__typeof__ (a)) (b)) #elif 202311 <= __STDC_VERSION__ # define _GL_STDBIT_TYPEOF_CAST(a, b) ((typeof (a)) (b))