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

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 10, 2016, 13:00 UTC
Message-ID
<26c2fb5560246fc7f980da24a239edc333864527.1462885167.git.johannes.schindelin@gmx.de>

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).
Published-As: https://github.com/dscho/git/releases/tag/mingw-sigmask-v1
 compat/win32/pthread.h | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index d336451..8df702c 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -104,9 +104,11 @@ static inline void *pthread_getspecific(pthread_key_t key)
 	return TlsGetValue(key);
 }
 
+#ifndef pthread_sigmask
 static inline int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
 {
 	return 0;
 }
+#endif
 
 #endif /* PTHREAD_H */
-- 
2.8.2.463.g99156ee
Next: Junio C Hamano
Message 1 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.