An updated version, using neither A or W, but just the macro. Am 21.01.2023 um 12:42 schrieb Eli Zaretskii: >> Date: Sat, 21 Jan 2023 11:47:42 +0100 >> Cc: gcc@hazardy.de, gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org >> From: Gabriel Ravier >> >> >> On 1/21/23 05:05, Eli Zaretskii wrote: >>>> Date: Fri, 20 Jan 2023 21:39:56 +0100 >>>> Cc: gcc@hazardy.de, gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org >>>> From: Gabriel Ravier >>>> >>>>>> - using wide APIs with Windows is generally considered to be a best >>>>>> practice, even when not strictly needed (and in this case I can't see >>>>>> any problem with doing so, unless maybe we want to code to work with >>>>>> Windows 95 or something like that...) >>>>> There's no reason to forcibly break GDB on platforms where wide APIs >>>>> are not available. >>>> Are there even any platforms that have GetModuleHandleA but not >>>> GetModuleHandleW ? MSDN states that Windows XP and Windows Server 2003 >>>> are the first versions to support both of the APIs, so if this is >>>> supposed to work on Windows 98, for instance, whether we're using >>>> GetModuleHandleA or GetModuleHandleW won't matter. >>> I'm not sure I follow the logic. A program that calls >>> GetModuleHandleW will refuse to start on Windows that doesn't have >>> that API. So any version before XP is automatically excluded the >>> moment you use code which calls that API directly (i.e. not through a >>> function pointer or somesuch). >> A program that calls GetModuleHandleA will also refuse to start on >> Windows if it doesn't have that API. The set of Windows versions that do >> not have GetModuleHandleA is, according to MSDN, the same as the set of >> Windows versions that do not have GetModuleHandleW. > > MSDN lies (because it wants to pretend that older versions don't > exist). Try this much more useful site: > > http://winapi.freetechsecrets.com/win32/WIN32GetModuleHandle.htm