public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-muller-windows-multi:  * Add _G_SUFFIX macro and use it for GetModuleFilenameEx
@ 2011-03-18 17:20 muller
  0 siblings, 0 replies; only message in thread
From: muller @ 2011-03-18 17:20 UTC (permalink / raw)
  To: archer-commits

The branch, archer-muller-windows-multi has been updated
       via  03c052c51f1e09a7572a52d73420aa0bb2fa5196 (commit)
      from  848eb3c6e899b82fecea1503f86e16d43b660d01 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 03c052c51f1e09a7572a52d73420aa0bb2fa5196
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Fri Mar 18 18:20:43 2011 +0100

     * Add _G_SUFFIX macro and use it for GetModuleFilenameEx

-----------------------------------------------------------------------

Summary of changes:
 gdb/common/windows-hdep.h |    8 ++++----
 gdb/windows-nat.c         |   19 +++----------------
 2 files changed, 7 insertions(+), 20 deletions(-)

First 500 lines of diff:
diff --git a/gdb/common/windows-hdep.h b/gdb/common/windows-hdep.h
index 65b1ce5..29d99fb 100644
--- a/gdb/common/windows-hdep.h
+++ b/gdb/common/windows-hdep.h
@@ -70,14 +70,14 @@
 
 #ifdef USE_WIDE_WINAPI
 # define _G(text) L##text
+# define _G_SUFFIX(text) (text "W")
+# define LPGSTR LPWSTR
 # define WINDOWS_POSIX_TO_NATIVE WINDOWS_POSIX_TO_NATIVE_W
 # define WINDOWS_NATIVE_TO_POSIX WINDOWS_NATIVE_W_TO_POSIX
   typedef wchar_t win_buf_t;
 # define STARTUPINFO STARTUPINFOW
 # define CreateProcess CreateProcessW
 # define GetSystemDirectory GetSystemDirectoryW
-# define GetModuleFileNameEx_name "GetModuleFileNameExW"
-# define bad_GetModuleFileNameEx bad_GetModuleFileNameExW
 # define gdb_windows_strlen wstrlen
 # define gdb_windows_strcat wcscat
 /* Mingw has a special swprintf function without length argument.  */
@@ -86,14 +86,14 @@
 #endif
 #else /* not USE_WIDE_WINAPI */
 # define _G(text) text
+# define _G_SUFFIX(text) (text "A")
+# define LPGSTR LPSTR
 # define WINDOWS_POSIX_TO_NATIVE WINDOWS_POSIX_TO_NATIVE_A
 # define WINDOWS_NATIVE_TO_POSIX WINDOWS_NATIVE_A_TO_POSIX
   typedef char win_buf_t;
 # define STARTUPINFO STARTUPINFOA
 # define CreateProcess CreateProcessA
 # define GetSystemDirectory GetSystemDirectoryA
-# define GetModuleFileNameEx_name "GetModuleFileNameExA"
-# define bad_GetModuleFileNameEx bad_GetModuleFileNameExA
 # define gdb_windows_strlen strlen
 # define gdb_windows_strcat strcat
 #endif /* not USE_WIDE_WINAPI */
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 8bc69fa..f5708e3 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -103,12 +103,7 @@ static BOOL WINAPI (*OpenProcessToken)(HANDLE, DWORD, PHANDLE);
 static BOOL WINAPI (*GetCurrentConsoleFont) (HANDLE, BOOL,
 					     CONSOLE_FONT_INFO *);
 static COORD WINAPI (*GetConsoleFontSize) (HANDLE, DWORD);
-#ifdef USE_WIDE_WINAPI
-  static DWORD WINAPI (*GetModuleFileNameEx) (HANDLE, HMODULE,
-					      LPWSTR, DWORD);
-#else
-  static DWORD WINAPI (*GetModuleFileNameEx) (HANDLE, HMODULE, LPSTR, DWORD);
-#endif
+static DWORD WINAPI (*GetModuleFileNameEx) (HANDLE, HMODULE, LPGSTR, DWORD);
 static BOOL WINAPI (*GetFileInformationByHandleEx) (HANDLE, DWORD,
 						    LPVOID, DWORD);
 
@@ -3235,19 +3230,11 @@ bad_EnumProcessModules (HANDLE w, HMODULE *x, DWORD y, LPDWORD z)
   return FALSE;
 }
 
-#ifdef USE_WIDE_WINAPI
-static DWORD WINAPI
-bad_GetModuleFileNameExW (HANDLE w, HMODULE x, LPWSTR y, DWORD z)
-{
-  return 0;
-}
-#else
 static DWORD WINAPI
-bad_GetModuleFileNameExA (HANDLE w, HMODULE x, LPSTR y, DWORD z)
+bad_GetModuleFileNameEx (HANDLE w, HMODULE x, LPGSTR y, DWORD z)
 {
   return 0;
 }
-#endif
 
 static BOOL WINAPI
 bad_GetModuleInformation (HANDLE w, HMODULE x, LPMODULEINFO y, DWORD z)
@@ -3334,7 +3321,7 @@ _initialize_loadable (void)
       GetModuleInformation = (void *)
 	GetProcAddress (hm, "GetModuleInformation");
       GetModuleFileNameEx = (void *)
-	GetProcAddress (hm, GetModuleFileNameEx_name);
+	GetProcAddress (hm, _G_SUFFIX ("GetModuleFileNameEx"));
     }
 
   if (!EnumProcessModules || !GetModuleInformation || !GetModuleFileNameEx)


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-18 17:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-18 17:20 [SCM] archer-muller-windows-multi: * Add _G_SUFFIX macro and use it for GetModuleFilenameEx muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).