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

[PATCH] git-compat-util.h: remove redundant code

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Feb 23, 2015, 00:07 UTC
Message-ID
<54EA6F32.50301@ramsay1.demon.co.uk>

Since commit 3a0a3a89 ("git-compat-util.h: don't define _XOPEN_SOURCE on cygwin", 23-11-2014) removed the definition of _XOPEN_SOURCE on cygwin, the code within a pre-processor conditional further down the file became redundant. Remove the redundant code.

This effectively reverts commit 41b20017 ("Fix an "implicit function definition" warning", 03-03-2007).

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Junio,

I have a very vague recollection (back in March 2007) of trying to fix the problem from commit 41b20017 using the solution in commit 3a0a3a89. However, I can't remember the result! :(

I guess, by implication, there is a chance that it failed because (at that time) something required _XOPEN_SOURCE to be set on cygwin. It is clearly not the case for the current version of cygwin (v1.7.34, x86_64). (I also tested on my old 32-bit laptop with an older cygwin - it's been about a year since I updated that version of cygwin.)

[Hmm, would it be easier to change the conditional(s) to set _XOPEN_SOURCE only for systems that require it (rather than avoid setting it for those that don't)! I suspect only sun, AIX 5.3L and OpenBSD need it set. dunno.]

ATB, Ramsay Jones

 git-compat-util.h | 6 ------
 1 file changed, 6 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index 68c07af..49c0637 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -164,16 +164,10 @@
 typedef long intptr_t;
 typedef unsigned long uintptr_t;
 #endif
-#if defined(__CYGWIN__)
-#undef _XOPEN_SOURCE
-#include <grp.h>
-#define _XOPEN_SOURCE 600
-#else
 #undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
 #include <grp.h>
 #define _ALL_SOURCE 1
 #endif
-#endif
 
 /* used on Mac OS X */
 #ifdef PRECOMPOSE_UNICODE
-- 
2.3.0
Message 1 of 1 in “git-compat-util.h: remove redundant code”
  1. git-compat-util.h: remove redundant codeRamsay Jones, Feb 23, 2015

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.