From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21032 invoked by alias); 7 Jan 2009 11:24:39 -0000 Received: (qmail 21021 invoked by uid 22791); 7 Jan 2009 11:24:38 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jan 2009 11:24:32 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6A2FC2A964C for ; Wed, 7 Jan 2009 06:24:30 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7yXMq21up5NT for ; Wed, 7 Jan 2009 06:24:30 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7B3BD2A9675 for ; Wed, 7 Jan 2009 06:24:29 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 6B5F1E7ACD; Wed, 7 Jan 2009 15:24:22 +0400 (RET) Date: Wed, 07 Jan 2009 11:24:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/win32] Avoid a couple of name collisions in win32-nat.c Message-ID: <20090107112422.GB1751@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="s2ZSL+KKDSLx8OML" Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-01/txt/msg00080.txt.bz2 --s2ZSL+KKDSLx8OML Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 728 This patch simply renames a couple of global variables that are pointers to routines imported from kernel32. The reason why they need to be renamed is that the names chosen were identical to the name in kernel32, and the declaration is clashing with the declaration in winbase.h. I followed the example of the routines imported in psapi.dll where the name is prefixed by psapi_. 2009-01-07 Joel Brobecker * win32-nat.c (kernel32_DebugSetProcessKillOnExit): Renames DebugSetProcessKillOnExit. Update all uses in this file. (kernel32_DebugActiveProcessStop): Renames DebugActiveProcessStop. Update all uses in this file. Tested on x86-windows. OK to apply? -- Joel --s2ZSL+KKDSLx8OML Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="clash.diff" Content-length: 2287 diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index ed37cb4..0c1ec05 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -1581,8 +1581,8 @@ do_initial_win32_stuff (struct target_ops *ops, DWORD pid, int attaching) If loading these functions succeeds use them to actually detach from the inferior process, otherwise behave as usual, pretending that detach has worked. */ -static BOOL WINAPI (*DebugSetProcessKillOnExit)(BOOL); -static BOOL WINAPI (*DebugActiveProcessStop)(DWORD); +static BOOL WINAPI (*kernel32_DebugSetProcessKillOnExit)(BOOL); +static BOOL WINAPI (*kernel32_DebugActiveProcessStop)(DWORD); static int has_detach_ability (void) @@ -1593,13 +1593,14 @@ has_detach_ability (void) kernel32 = LoadLibrary ("kernel32.dll"); if (kernel32) { - if (!DebugSetProcessKillOnExit) - DebugSetProcessKillOnExit = GetProcAddress (kernel32, + if (!kernel32_DebugSetProcessKillOnExit) + kernel32_DebugSetProcessKillOnExit = GetProcAddress (kernel32, "DebugSetProcessKillOnExit"); - if (!DebugActiveProcessStop) - DebugActiveProcessStop = GetProcAddress (kernel32, + if (!kernel32_DebugActiveProcessStop) + kernel32_DebugActiveProcessStop = GetProcAddress (kernel32, "DebugActiveProcessStop"); - if (DebugSetProcessKillOnExit && DebugActiveProcessStop) + if (kernel32_DebugSetProcessKillOnExit + && kernel32_DebugActiveProcessStop) return 1; } return 0; @@ -1719,7 +1720,7 @@ win32_attach (struct target_ops *ops, char *args, int from_tty) error (_("Can't attach to process.")); if (has_detach_ability ()) - DebugSetProcessKillOnExit (FALSE); + kernel32_DebugSetProcessKillOnExit (FALSE); if (from_tty) { @@ -1749,13 +1750,13 @@ win32_detach (struct target_ops *ops, char *args, int from_tty) ptid_t ptid = {-1}; win32_resume (ptid, 0, TARGET_SIGNAL_0); - if (!DebugActiveProcessStop (current_event.dwProcessId)) + if (!kernel32_DebugActiveProcessStop (current_event.dwProcessId)) { error (_("Can't detach process %lu (error %lu)"), current_event.dwProcessId, GetLastError ()); detached = 0; } - DebugSetProcessKillOnExit (FALSE); + kernel32_DebugSetProcessKillOnExit (FALSE); } if (detached && from_tty) { --s2ZSL+KKDSLx8OML--