From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, BULK_RE_SUSP_NTLD,FROM_SUSPICIOUS_NTLD,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 585771FA04 for ; Sat, 30 May 2020 14:46:32 +0000 (UTC) Received: from localhost ([::1]:51334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jf2kp-0000Cg-5k for normalperson@yhbt.net; Sat, 30 May 2020 10:46:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jf2kl-0000CX-L1 for bug-gnulib@gnu.org; Sat, 30 May 2020 10:46:27 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:24620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1jf2ki-0005xR-IY for bug-gnulib@gnu.org; Sat, 30 May 2020 10:46:26 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 49Z44t5LWBzQlKD; Sat, 30 May 2020 16:46:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id SwaaCWASoI0J; Sat, 30 May 2020 16:46:14 +0200 (CEST) Date: Sat, 30 May 2020 16:46:13 +0200 (CEST) From: Steve Lhomme To: Bruno Haible Message-ID: <1466973409.18549.1590849973502@office.mailbox.org> In-Reply-To: <2094033.ASjxsvSHS8@omega> References: <20200519062610.8378-1-robux4@ycbcr.xyz> <6006694.lM23qYLBot@omega> <1262823724.18090.1590842760428@office.mailbox.org> <2094033.ASjxsvSHS8@omega> Subject: Re: Don't assume that UNICODE is not defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 676931738 X-Rspamd-Score: -0.20 / 15.00 / 15.00 Received-SPF: pass client-ip=80.241.56.171; envelope-from=robux4@ycbcr.xyz; helo=mout-p-201.mailbox.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/30 10:46:23 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Steve Lhomme Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" > On May 30, 2020 4:31 PM Bruno Haible wrote: > > > Steve Lhomme wrote: > > Why not use the proper call in the first place rather than use a define ? > > It could be useful in a generic header used by all to make sure everyone > > uses the right thing. But since you need to edit each file it would be > > cleaner not to use any define at all and use the proper functions and > > structures directly. > > It would be possible. But > - It is ugly. > - The correct search term on microsoft.com, stackoverflow.com, etc. is > 'LoadLibrary', not 'LoadLibraryA'. Let's speak the same language as > everyone else is speaking. Microsoft.com doesn't document the function as LoadLibrary anymore. There is LoadLibraryA and LoadLibraryW. https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibrarya https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryw It even says the following: The libloaderapi.h header defines LoadLibrary as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes. Given the name of the header that's not what should be used from now on. Using the old names gives a sense of safety you don't actually have. Looking at the code I would assume, like any currently maintained code, that the default is to call UNICODE API's. But I don't find any mention of WideCharToMultiByte or CP_UTF8 in the code. And from the patch you did it's quite the opposite.