intprops, stdbit-h: Fix error on MSVC in C++ mode (regr. 2024-12-19).

* lib/intprops-internal.h (_GL_HAVE___TYPEOF__): Set to 0 on MSVC in
C++ mode.
* lib/stdbit.in.h (_GL_STDBIT_TYPEOF_CAST): Don't use __typeof__ on MSVC
in C++ mode.
This commit is contained in:
Bruno Haible
2026-06-19 11:10:06 +02:00
parent 47e567332c
commit 7f52db1d99
3 changed files with 11 additions and 3 deletions
+8
View File
@@ -1,3 +1,11 @@
2026-06-07 Bruno Haible <bruno@clisp.org>
intprops, stdbit-h: Fix error on MSVC in C++ mode (regr. 2024-12-19).
* lib/intprops-internal.h (_GL_HAVE___TYPEOF__): Set to 0 on MSVC in
C++ mode.
* lib/stdbit.in.h (_GL_STDBIT_TYPEOF_CAST): Don't use __typeof__ on MSVC
in C++ mode.
2026-06-06 Bruno Haible <bruno@clisp.org>
mbrtowc: Fix handling of s==NULL on all possible platforms.
+2 -2
View File
@@ -1,6 +1,6 @@
/* intprops-internal.h -- properties of integer types not visible to users
Copyright (C) 2001-2025 Free Software Foundation, Inc.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
@@ -81,7 +81,7 @@
|| (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))
|| (defined _MSC_VER && 1939 <= _MSC_VER && !defined __cplusplus))
# define _GL_HAVE___TYPEOF__ 1
#else
# define _GL_HAVE___TYPEOF__ 0
+1 -1
View File
@@ -90,7 +90,7 @@ _GL_INLINE_HEADER_BEGIN
|| (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))
|| (defined _MSC_VER && 1939 <= _MSC_VER && !defined __cplusplus))
# define _GL_STDBIT_TYPEOF_CAST(a, b) ((__typeof__ (a)) (b))
#elif 202311 <= __STDC_VERSION__
# define _GL_STDBIT_TYPEOF_CAST(a, b) ((typeof (a)) (b))