[PATCH 0/1] MR10644: include: Don't use _MSC_VER if it isn't defined.
From: Rémi Bernon <rbernon@codeweavers.com> --- include/specstrings.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/specstrings.h b/include/specstrings.h index 4d404759c2e..a26c8d7feac 100644 --- a/include/specstrings.h +++ b/include/specstrings.h @@ -328,7 +328,9 @@ extern "C" { #endif /* RC_INVOKED */ #ifndef DECLSPEC_ADDRSAFE -#if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) +#ifndef _MSC_VER +#define DECLSPEC_ADDRSAFE +#elif (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) #define DECLSPEC_ADDRSAFE __declspec(address_safe) #else #define DECLSPEC_ADDRSAFE -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10644
https://en.cppreference.com/w/c/preprocessor/conditional.html#Conditional_ev...
Any identifier, which is not literal, non defined using #define directive, evaluates to 0
Is some random compiler printing absurd warnings or something? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10644#note_135947
On Mon Apr 13 11:00:21 2026 +0000, Alfred Agrell wrote:
https://en.cppreference.com/w/c/preprocessor/conditional.html#Conditional_ev...
Any identifier, which is not literal, non defined using #define directive, evaluates to 0 Is some random compiler printing absurd warnings or something? Not really I was just using -Wundef for some random reason and found this. And I remember (or perhaps misremember) @julliard telling me that we cannot use preprocessor symbols unless they are defined.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10644#note_135948
On Mon Apr 13 11:00:21 2026 +0000, Rémi Bernon wrote:
Not really I was just using -Wundef for some random reason and found this. And I remember (or perhaps misremember) @julliard telling me that we cannot use preprocessor symbols unless they are defined. https://gitlab.winehq.org/wine/wine/-/merge_requests/5915#note_74386 mostly, but maybe I misunderstood what the comment was about, or maybe it's not exactly the same thing. Anyway I'll close this if it's not considered useful.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10644#note_135949
On Mon Apr 13 11:03:12 2026 +0000, Rémi Bernon wrote:
https://gitlab.winehq.org/wine/wine/-/merge_requests/5915#note_74386 mostly, but maybe I misunderstood what the comment was about, or maybe it's not exactly the same thing. Anyway I'll close this if it's not considered useful. If \__has_builtin isn't defined, then #if \__has_builtin(__cpuidex) is equivalent to #if 0(0) which is a syntax error. https://godbolt.org/z/3333Y7bb3
I'd vote close, but it's not my call. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10644#note_135951
On Mon Apr 13 11:11:33 2026 +0000, Alfred Agrell wrote:
If \__has_builtin isn't defined, then #if \__has_builtin(__cpuidex) is equivalent to #if 0(0) which is a syntax error. https://godbolt.org/z/3333Y7bb3 I'd vote close, but it's not my call. Well it was the other way around with the || possibly short circuiting the rest, but I see, and it indeed fails to parse if the token isn't defined.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10644#note_135955
This merge request was closed by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10644
participants (3)
-
Alfred Agrell (@Alcaro) -
Rémi Bernon -
Rémi Bernon (@rbernon)