From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.emacs.devel Subject: Re: Gnulib's boot-time.c breaks the build with mingw.org's MinGW Date: Tue, 04 Jun 2024 21:46:41 +0300 Message-ID: <86sexsk0ku.fsf@gnu.org> References: <86tti8k710.fsf@gnu.org> <87ikyok0xb.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1499"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eggert@cs.ucla.edu, bruno@clisp.org, emacs-devel@gnu.org, bug-gnulib@gnu.org To: Collin Funk Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Tue Jun 04 20:47:20 2024 Return-path: Envelope-to: gnu-bug-gnulib@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sEZBo-0000Aq-0e for gnu-bug-gnulib@m.gmane-mx.org; Tue, 04 Jun 2024 20:47:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEZBK-00079k-I7; Tue, 04 Jun 2024 14:46:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEZBH-00078m-Vl; Tue, 04 Jun 2024 14:46:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEZBG-0001hx-12; Tue, 04 Jun 2024 14:46:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=51RoGgRS7YNOe2jU2k4zSVm/u7RXnqDdGAvD8X38G80=; b=C4FsFxyvntGN yYmK3DnkhqpPYGHGYlMieo5Gne3M8MY9crvA75YOF9wOhc2823/9Io4k00hRHtxiRTZAqz4zbSmYH Nymjnr3bqbySbecGMBcz3HHzFGmpapciGuvtXv5quXIXPexIK4ybUpqaA2THq5BqH8S5F9FvPmUaw G5oIkQ/23QBG+9noecGa+9IsqIfoNfNeAJYhFbxBTU5xY6l0TC2p3pOPF8MkJDlmS75tIeMruSrS3 RM2Of+XrGMOo2Oj5qQkHp+mORfRsbvz2gLbd4cCyosqTR7Et9W9GzqC3tVyDtZfjfWxZtVUofV9vN hksTJSeUx76YgJdt8OI6PQ==; In-Reply-To: <87ikyok0xb.fsf@gmail.com> (message from Collin Funk on Tue, 04 Jun 2024 11:39:12 -0700) X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Original-Sender: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.comp.lib.gnulib.bugs:50700 gmane.emacs.devel:319824 Archived-At: > From: Collin Funk > Cc: Paul Eggert , Bruno Haible , > emacs-devel@gnu.org, bug-gnulib@gnu.org > Date: Tue, 04 Jun 2024 11:39:12 -0700 > > Eli Zaretskii writes: > > > However, that header is not really needed here because the > > signature of the GetTickCount64 function, which boot-time-aux.h now > > calls, is completely defined in boot-time-aux.h: > > > > typedef ULONGLONG (WINAPI * GetTickCount64FuncType) (void); > [...] > > So I think the Gnulib code should be amended not to include > > sysinfoapi.h. For the time being I made a local change in Emacs, to > > be able to build the master branch with MinGW, but I don't think it's > > an Emacs-specific issue. > > Thanks for the report. > > This code was a backup method for getting the boot time on Windows that > I added recently. On my system #include includes > which then includes unconditionally. Therefore you are > correct that there is no need to include it. I've applied the attached > patch in Gnulib fixing this. Thanks. Paul, please import this into our repository when you have time, reverting my change when you do. > Were you using an older Windows version perhaps? For older systems where > the function isn't declared in headers (_WIN32_WINNT < _WIN32_WINNT_VISTA) > the dll is loaded and it tries to get the function address from there. I'm on Windows 11, but that's not important. One can set _WIN32_WINNT to any value during compilation, regardless of the underlying system. _WIN32_WINNT is about which versions your application targets when it runs, as I'm sure you know very well. In any case, in the case in point we don't need the prototype of GetTickCount64 because the code calls the function via a function pointer, and loads it dynamically at run time. > Note that the line of code you sent is a typedef not a declaration. :) I know. But since the function is not called directly, the typedef declares its signature, and nothing else is required for the code to compile. (We could need the header if the code used some macros or data structures defined on that header, but this is not the case here.)