From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 2C51F395A07F; Thu, 2 Jun 2022 09:40:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C51F395A07F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon TURNEY To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix Cygwin build after fcab5839 X-Act-Checkin: binutils-gdb X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: 6a031255cf1842447a143849e720349eb00533d2 X-Git-Newrev: c9c157c7650a7570123869445e7dd331ecdd3317 Message-Id: <20220602094036.2C51F395A07F@sourceware.org> Date: Thu, 2 Jun 2022 09:40:36 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2022 09:40:36 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dc9c157c7650a= 7570123869445e7dd331ecdd3317 commit c9c157c7650a7570123869445e7dd331ecdd3317 Author: Jon Turney Date: Fri May 20 14:35:57 2022 +0100 Fix Cygwin build after fcab5839 =20 Fix Cygwin build after fcab5839 ("Implement pid_to_exec_file for Windows in gdbserver"). That change moves code from gdb/windows-nat.c to gdb/nat/windows-nat.c, but doesn't add the required typedefs and includes for parts of that code under ifdef __CYGWIN__. Diff: --- gdb/nat/windows-nat.c | 9 ++++++++- gdb/windows-nat.c | 3 --- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index 71a18a0efa9..f6818015c53 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -21,8 +21,15 @@ #include "gdbsupport/common-debug.h" #include "target/target.h" =20 -#ifdef __CYGWIN__ +#undef GetModuleFileNameEx + +#ifndef __CYGWIN__ +#define GetModuleFileNameEx GetModuleFileNameExA +#else +#include #define __USEWIDE +typedef wchar_t cygwin_buf_t; +#define GetModuleFileNameEx GetModuleFileNameExW #endif =20 namespace windows_nat diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 11f54302b11..6c6dea84bfa 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -79,11 +79,9 @@ static windows_process_info windows_process; =20 #undef STARTUPINFO #undef CreateProcess -#undef GetModuleFileNameEx =20 #ifndef __CYGWIN__ # define __PMAX (MAX_PATH + 1) -# define GetModuleFileNameEx GetModuleFileNameExA # define STARTUPINFO STARTUPINFOA # define CreateProcess CreateProcessA #else @@ -93,7 +91,6 @@ static windows_process_info windows_process; static CORE_ADDR cygwin_load_end; # define __USEWIDE typedef wchar_t cygwin_buf_t; -# define GetModuleFileNameEx GetModuleFileNameExW # define STARTUPINFO STARTUPINFOW # define CreateProcess CreateProcessW #endif