bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gettimeofday.c windows version?


From: Paul Eggert
Subject: Re: gettimeofday.c windows version?
Date: Mon, 12 Dec 2022 11:44:43 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

On 12/12/22 06:40, Eli Zaretskii wrote:
A program's build could use certain cpp switches for some of its
sources, and other switches for the other sources.

It should be easy to arrange for Emacs to compile Gnulib source code with whatever value of _WIN32_WINNT is appropriate for Gnulib, by modifying emacs/lib/Makefile.in appropriately. For example, we could leave gettimeofday.c alone add a line like this to Makefile.in:

   ALL_CFLAGS += -D_WIN32_WINNT=_WIN32_WINNT_WINXP

Would something like this address the issue you're thinking of?

(This is one reason why _WIN32_WINNT is in general not a good idea,

Yes, I see several instances of "#define _WIN32_WINNT 0x..." in Emacs, including some temporary ones where _WIN32_WINNT is temporarily set to one value and then restored to its original value. I'm hoping similar complexity isn't needed in Gnulib.

Currently Gnulib #defines _WIN32_WINNT in three source code files: lib/ftruncate.c, lib/sethostname.c, and lib/stat-w32.c. Emacs doesn't use any of these files, so they aren't a problem for Emacs. Still, from what you say it might make sense for these three files to not #define _WIN32_WINNT (not that I know what's going on there, as I don't use MS-Windows).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]