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=-3.3 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,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=ham 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 DD18A1F55B for ; Fri, 29 May 2020 10:34:45 +0000 (UTC) Received: from localhost ([::1]:48566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jecLc-0006Ch-Kk for normalperson@yhbt.net; Fri, 29 May 2020 06:34:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jecLZ-0006CL-Nh for bug-gnulib@gnu.org; Fri, 29 May 2020 06:34:41 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.219]:32529) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jecLX-0004HK-Ii; Fri, 29 May 2020 06:34:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1590748475; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=BVhh41yZrwTCZCAjvugQRo3QVhgZaXybCodcafdAI7k=; b=QB3nAqbHnS/uNQdbTlGDWkwV0XkxB5QkAqxFo5cxi2kNLo4j4FDPHU4GJ3SeGmH9aD rfCyQzM+ZngaPNMH+jSPMFqG8zW7kMMwa+a/MBzf2zNFgIFXkqr2wXnkLBP8edBrfStQ 7F+2hztfr2c1teyWtP1IX++6wbiQafywm+DZ50XIa1Uu68swhWF1kqJ2nbbqmIxWlOmv 5QMZc28HdBYqdTpLv4CQ0voBP7gc4orGAjsqCPP8obAXEEeG2fYLWgY3JSHdFw6JG3kc vat4OvRHZxizob9yp7skFMCqmnrd5hA44BBUseMfTZQjw/PgN761vVxWDK74oU7c6RD3 FKPw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.9.0 DYNA|AUTH) with ESMTPSA id j03713w4TAYU7Cj (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Fri, 29 May 2020 12:34:30 +0200 (CEST) From: Bruno Haible To: Daiki Ueno Subject: Re: [PATCH] gettimeofday: do not use LoadLibrary when built for Windows Store apps Date: Fri, 29 May 2020 12:34:29 +0200 Message-ID: <5432737.86AFa8QnEj@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <87sgfje343.fsf-ueno@gnu.org> References: <20200519062424.8282-1-robux4@ycbcr.xyz> <8510036.Z2lXjDNy1T@omega> <87sgfje343.fsf-ueno@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.219; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/29 06:34:36 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_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: , Cc: Steve Lhomme , bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Daiki Ueno wrote: > this change seems to > break MinGW cross build, because GetFinalPathNameByHandleFunc is defined > only if !(_WIN32_WINNT >= _WIN32_WINNT_VISTA), but referred to from > _gl_convert_FILETIME_to_timespec without the guard: Oops, indeed. With the appropriate _WIN32_WINNT setting, I'm getting errors in all three files: C:\cygwin64\home\bruno\testdir2\gllib\gettimeofday.c(95): error C2065: 'GetSystemTimePreciseAsFileTimeFunc': undeclared identifier C:\cygwin64\home\bruno\testdir2\gllib\isatty.c(99): error C2065: 'GetNamedPipeClientProcessIdFunc': undeclared identifier C:\cygwin64\home\bruno\testdir2\gllib\isatty.c(100): error C2065: 'QueryFullProcessImageNameFunc': undeclared identifier C:\cygwin64\home\bruno\testdir2\gllib\stat-w32.c(259): error C2065: 'GetFinalPathNameByHandleFunc': undeclared identifier This patch fixes it. 2020-05-29 Bruno Haible Fix compilation error on native Windows (regression from 2020-05-28). Reported by Daiki Ueno. * lib/gettimeofday.c (GetSystemTimePreciseAsFileTimeFunc): Define as macro when not using dynamic loading. * lib/isatty.c (GetNamedPipeClientProcessIdFunc, QueryFullProcessImageNameFunc): Likewise. * lib/stat-w32.c (GetFileInformationByHandleExFunc, GetFinalPathNameByHandleFunc): Likewise. diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index 3d53115..93914ba 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -56,6 +56,10 @@ initialize (void) initialized = TRUE; } +# else + +# define GetSystemTimePreciseAsFileTimeFunc GetSystemTimePreciseAsFileTime + # endif #endif diff --git a/lib/isatty.c b/lib/isatty.c index fc771d1..4c5b8e3 100644 --- a/lib/isatty.c +++ b/lib/isatty.c @@ -71,6 +71,11 @@ initialize (void) initialized = TRUE; } +#else + +# define GetNamedPipeClientProcessIdFunc GetNamedPipeClientProcessId +# define QueryFullProcessImageNameFunc QueryFullProcessImageName + #endif static BOOL IsConsoleHandle (HANDLE h) diff --git a/lib/stat-w32.c b/lib/stat-w32.c index 02ad9ab..cca12dd 100644 --- a/lib/stat-w32.c +++ b/lib/stat-w32.c @@ -78,6 +78,11 @@ initialize (void) initialized = TRUE; } +#else + +# define GetFileInformationByHandleExFunc GetFileInformationByHandleEx +# define GetFinalPathNameByHandleFunc GetFinalPathNameByHandle + #endif /* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */