git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Windows: only add a no-op pthread_sigmask() when needed

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 11, 2016, 15:06 UTC
Message-ID
<alpine.DEB.2.20.1605111655350.4092@virtualbox>
In-Reply-To
<xmqqvb2lpzij.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Tue, 10 May 2016, Junio C Hamano wrote:
Show 22 quoted lines
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> 
> > In f924b52 (Windows: add pthread_sigmask() that does nothing,
> > 2016-05-01), we introduced a no-op for Windows. However, this breaks
> > building Git in Git for Windows' SDK because pthread_sigmask() is
> > already a no-op there, #define'd in the pthread_signal.h header in
> > /mingw64/x86_64-w64-mingw32/include/.
> >
> > Let's guard the definition of pthread_sigmask() in #ifndef...#endif to
> > make the code compile both with modern MinGW-w64 as well as with the
> > previously common MinGW headers.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >
> > 	This patch is obviously based on 'next' (because 'master' does not
> > 	have the referenced commit yet).
> 
> One thing that makes me wonder is what would happen when
> /mingw64/x86_64-w64-mingw32/include/pthread_signal.h changes its
> mind and uses "static inline" instead of "#define".  How much
> control does Git-for-Windows folks have over that header file?

We have no control over this, it is defined by one of the MSYS2 packages. (I think those headers come directly from the MinGW-w64 GCC project.)

I can think of two different ways to resolve this, would you please indicate your preference?

1. fix the non-POSIX-ness:
	#ifdef pthread_sigmask
	#undef pthread_sigmask
	#endif
   or even shorter:
	#undef pthread_sigmask
2. just go with whatever MSYS2 provides:
	#ifndef __MINGW64_VERSION_MAJOR
	[... define the no-op ...]
	#endif
> Also, could you explain "However" part a bit?  Obviously in _some_
> environment other than "Git for Windows' SDK", the previous patch
> helped you compile.

Yes, Hannes uses his own MSys environment. (Which is different from everything *I* have, I think, it's not even msysGit.)

Show 11 quoted lines
> What I am trying to get at is:
> 
>  (1) If the answer is "we have total control", then I am perfectly
>      fine with using "#ifdef pthread_sigmask" here.
> 
>  (2) If not, i.e. "they can change the implementation to 'static
>      inline' themselves", then I do not think it is prudent to use
>      "#ifndef pthread_sigmask" as the conditional here--using a
>      symbol that lets you check for that "other" environment and
>      doing "#ifdef THAT_OTHER_ONE_THAT_LACKS_SIGMASK" would be
>      safer.

So I guess that you're preferring my 2. above. Going on that assumption, I will send out another iteration.

> Also is
> https://lists.gnu.org/archive/html/bug-gnulib/2015-04/msg00068.html
> relevant?  Does /mingw64/x86_64-w64-mingw32/include/ implement "macro
> only without function"?
Yes, it has that problem. Do we care, really?

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “Windows: only add a no-op pthread_sigmask() when needed”
  1. Windows: only add a no-op pthread_sigmask() when neededJohannes Schindelin, May 10, 2016
  2. Junio C HamanoMay 10, 2016
  3. Johannes SchindelinMay 11, 2016
  4. Junio C HamanoMay 11, 2016
  5. Windows: only add a no-op pthread_sigmask() when neededJohannes Schindelin, May 11, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.