git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rocco Rutte <pdmef@gmx.net>
To: git@vger.kernel.org
Cc: Rocco Rutte <pdmef@gmx.net>
Subject: [PATCH] Don't define _XOPEN_SOURCE to unbreak compilation on FreeBSD
Date: Thu, 21 Dec 2006 10:47:28 +0000	[thread overview]
Message-ID: <11666980484010-git-send-email-pdmef@gmx.net> (raw)
In-Reply-To: 7vk60lbnvj.fsf@assigned-by-dhcp.cox.net

FreeBSD 6 requires the __BSD_VISIBLE flag for fchmod(), IPPROTO_IPV6 and
more which is only properly set by <sys/cdefs.h> if _POSIX_C_SOURCE
isn't present. However, _POSIX_C_SOURCE is defined if _XOPEN_SOURCE is
defined and >=500.

As a solution, simply don't define _XOPEN_SOURCE for FreeBSD and continue
with its defaults.

Signed-off-by: Rocco Rutte <pdmef@gmx.net>
---
 git-compat-util.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index bc296b3..27d3b89 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -11,7 +11,12 @@
 
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
-#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
+#if !defined(__FreeBSD__)
+#define _XOPEN_SOURCE 600        /* glibc2 and AIX 5.3L need 500,
+                                  * OpenBSD needs 600 for S_ISLNK(),
+                                  * FreeBSD 6 doesn't like it
+                                  */
+#endif
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #define _GNU_SOURCE
 #define _BSD_SOURCE
-- 
1.4.4.2.g9474f

                 reply	other threads:[~2006-12-21 10:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11666980484010-git-send-email-pdmef@gmx.net \
    --to=pdmef@gmx.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).