{"thread":{"id":"6055","subject":"[PATCH] Don't define _XOPEN_SOURCE to unbreak compilation on FreeBSD","startedAt":"2006-12-21T10:47:28Z","lastAt":"2006-12-21T10:47:28Z","messageCount":1,"participants":["Rocco Rutte"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"29931","messageId":"11666980484010-git-send-email-pdmef@gmx.net","threadId":"6055","inReplyTo":null,"subject":"[PATCH] Don't define _XOPEN_SOURCE to unbreak compilation on FreeBSD","fromName":"Rocco Rutte","fromEmail":"pdmef@gmx.net","sentAt":"2006-12-21T10:47:28Z","receivedAt":"2006-12-21T10:47:28Z","isPatch":true,"sender":{"key":"pdmef@gmx.net","avatar":null},"body":"FreeBSD 6 requires the __BSD_VISIBLE flag for fchmod(), IPPROTO_IPV6 and\nmore which is only properly set by <sys/cdefs.h> if _POSIX_C_SOURCE\nisn't present. However, _POSIX_C_SOURCE is defined if _XOPEN_SOURCE is\ndefined and >=500.\n\nAs a solution, simply don't define _XOPEN_SOURCE for FreeBSD and continue\nwith its defaults.\n\nSigned-off-by: Rocco Rutte <pdmef@gmx.net>\n---\n git-compat-util.h |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex bc296b3..27d3b89 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -11,7 +11,12 @@\n \n #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))\n \n-#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n+#if !defined(__FreeBSD__)\n+#define _XOPEN_SOURCE 600        /* glibc2 and AIX 5.3L need 500,\n+                                  * OpenBSD needs 600 for S_ISLNK(),\n+                                  * FreeBSD 6 doesn't like it\n+                                  */\n+#endif\n #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n #define _GNU_SOURCE\n #define _BSD_SOURCE\n-- \n1.4.4.2.g9474f\n"}]}