threads / patch / 6052

patchDefine -D__BSD_VISIBLE for FreeBSD

Subject: [PATCH] Define -D__BSD_VISIBLE for FreeBSD

## tl;dr

3 messages between Dec 21, 2006 and Dec 21, 2006. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Rocco Rutte· Dec 21, 2006, 09:00 UTC · lore

FreeBSD (6-STABLE) "hides" many declarations (like fchmod(), IPPROTO_IPV6, etc.) within '#ifdef __BSD_VISIBLE' blocks. Without this flag, compilation will produce lots of warnings and will even fail to compile daemon.c since IPPROTO_IPV6 isn't available without it.

>From looking at some include files of OpenBSD and NetBSD (via cvsweb)
they don't seem to need this flag.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to Makefile +1 −1
diff --git a/Makefile b/Makefile
index 7651104..46c49e0 100644
--- a/Makefile
+++ b/Makefile
@@ -366,7 +366,7 @@ ifeq ($(uname_O),Cygwin)
 endif
 ifeq ($(uname_S),FreeBSD)
 	NEEDS_LIBICONV = YesPlease
-	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_CFLAGS += -I/usr/local/include -D__BSD_VISIBLE
 	BASIC_LDFLAGS += -L/usr/local/lib
 endif
 ifeq ($(uname_S),OpenBSD)
-- 
1.4.4.2.g9474f
Junio C Hamano· Dec 21, 2006, 09:26 UTC · re: Rocco Rutte · lore

Re: [PATCH] Define -D__BSD_VISIBLE for FreeBSD

Rocco Rutte <pdmef@gmx.net> writes:
> FreeBSD (6-STABLE) "hides" many declarations (like fchmod(), IPPROTO_IPV6,
> etc.) within '#ifdef __BSD_VISIBLE' blocks. Without this flag, compilation
> will produce lots of warnings and will even fail to compile daemon.c
> since IPPROTO_IPV6 isn't available without it.

I've looked at OpenBSD header files and my impression was that the symbol __BSD_VISIBLE was pretty much internal to the implementation, and the programs are not expected to set it except by defining more public feature macros, such as _BSD_SOURCE. So I feel a bit uneasy about your approach.

We've changed this exact area quite heavily during the last 24-hours (not in Makefile but in git-compat-util.h). Do you see the problem with the latest 'master'?

Rocco Rutte· Dec 21, 2006, 10:09 UTC · re: Junio C Hamano · lore

Re: [PATCH] Define -D__BSD_VISIBLE for FreeBSD

Hi,
* Junio C Hamano [06-12-21 01:26:56 -0800] wrote:
>We've changed this exact area quite heavily during the last
>24-hours (not in Makefile but in git-compat-util.h).  Do you
>see the problem with the latest 'master'?

Now when looking at sys/cdefs.h, the 85023577a8f4b540aa64aa37f6f44578c0c305a3 commit seems to have broken things. So the patch should be ignored and I'll try to come up with a better one not using implementation-defined __-macros...

   bye, Rocco
-- 
:wq!

← back to recent threads