threads / patch / 38631

patchgit-compat-util.h: remove redundant code

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

## tl;dr

One message between Feb 23, 2015 and Feb 23, 2015. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Ramsay Jones· Feb 23, 2015, 00:07 UTC · lore

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(-)
Show changes to git-compat-util.h +0 −6
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

← back to recent threads