Skip to content

Commit 41b2001

Browse files
Ramsay JonesJunio C Hamano
authored andcommitted
Fix an "implicit function definition" warning.
The function at issue being initgroups() from the <grp.h> header file. On Cygwin, setting _XOPEN_SOURCE suppresses the definition of initgroups(), which causes the warning while compiling daemon.c. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ee96d11 commit 41b2001

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git-compat-util.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,15 @@
4747
#include <netdb.h>
4848
#include <pwd.h>
4949
#include <inttypes.h>
50+
#if defined(__CYGWIN__)
51+
#undef _XOPEN_SOURCE
52+
#include <grp.h>
53+
#define _XOPEN_SOURCE 600
54+
#else
5055
#undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
5156
#include <grp.h>
5257
#define _ALL_SOURCE 1
58+
#endif
5359

5460
#ifndef NO_ICONV
5561
#include <iconv.h>

0 commit comments

Comments
 (0)