Skip to content

Commit 6555b19

Browse files
YONETANI Tomokazugitster
authored andcommitted
Fix _XOPEN_SOURCE problem on DragonFly
As on FreeBSD, defining _XOPEN_SOURCE to 600 on DragonFly BSD 2.4-RELEASE or later hides symbols from programs, which leads to implicit declaration of functions, making the return value to be assumed an int. On architectures where sizeof(int) < sizeof(void *), this can cause unexpected behaviors or crashes. This change won't affect other OSes unless they define __DragonFly__ macro, or older versions of DragonFly BSD as the current git code doesn't rely on the features only available with _XOPEN_SOURCE set to 600 on DragonFly. Signed-off-by: YONETANI Tomokazu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1f2362a commit 6555b19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-compat-util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
# else
5656
# define _XOPEN_SOURCE 500
5757
# endif
58-
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
58+
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
59+
!defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)
5960
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
6061
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
6162
#endif

0 commit comments

Comments
 (0)