Skip to content

Commit

Permalink
Fix _XOPEN_SOURCE problem on DragonFly
Browse files Browse the repository at this point in the history
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 <y0netan1@dragonflybsd.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
YONETANI Tomokazu authored and Junio C Hamano committed Apr 3, 2010
1 parent 1f2362a commit 6555b19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
# else
# define _XOPEN_SOURCE 500
# endif
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
!defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
#endif
Expand Down

0 comments on commit 6555b19

Please sign in to comment.