Bug 31307 - gdb/symtab.h: SEARCH_ALL clashes with <winioctl.h> on MinGW
Summary: gdb/symtab.h: SEARCH_ALL clashes with <winioctl.h> on MinGW
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 15.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-29 09:55 UTC by Pekka Seppänen
Modified: 2024-02-01 16:19 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2024-01-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pekka Seppänen 2024-01-29 09:55:15 UTC
Hi.

Recent domain_search_flags patch [1] introduces a convenience constant SEARCH_ALL that unfortunately clashes with SEARCH_ALL macro that is defined <winioctl.h>.  

This header file is included indirectly when compiling gdb/mingw-hdep.c (via gdb/serial.h:23 -> /mingw-w64/include/winsock2.h:23 -> /mingw-w64/include/windows.h:97 -> /mingw-w64/include/winscard.h:11 -> /mingw-w64/include/winioctl.h).

A quick (and dirty) workaround would be to add #define NOCRYPT prior serial.h include.  However, in the long run, it might be more beneficial to move <windows.h> et. al. to a shared header that sets up all feature removal macros.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=25f31e1820dcec2f0c073c28cbf88646c7c2af97
Comment 1 Tom Tromey 2024-01-29 16:17:08 UTC
I don't mind renaming this, but FWIW I can't reproduce the
problem with my Fedora-hosted mingw cross.
Comment 2 Tom Tromey 2024-01-29 16:41:34 UTC
Aha, I was on the wrong branch, of course.
Comment 4 Sourceware Commits 2024-02-01 14:23:49 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f214edceb8cd97058c2682efb7b321d923e4ff02

commit f214edceb8cd97058c2682efb7b321d923e4ff02
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Jan 29 09:45:35 2024 -0700

    Rename SEARCH_ALL
    
    The constant SEARCH_ALL conflicts with a define in a Windows header.
    This patch renames the constant to SEARCH_ALL_DOMAINS to avoid the
    conflict.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31307
Comment 5 Tom Tromey 2024-02-01 16:19:05 UTC
Fixed.