# [PATCH] Define -D__BSD_VISIBLE for FreeBSD

3 messages from 2006-12-21 to 2006-12-21. Participants: Rocco Rutte, Junio C Hamano.
Thread: https://gitlist.dev/t/6052

## Rocco Rutte, 2006-12-21 09:00

Subject: [PATCH] Define -D__BSD_VISIBLE for FreeBSD
Message-ID: <11666916581935-git-send-email-pdmef@gmx.net>
URL: https://gitlist.dev/e/11666916581935-git-send-email-pdmef%40gmx.net

```
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(-)

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, 2006-12-21 09:26

Subject: Re: [PATCH] Define -D__BSD_VISIBLE for FreeBSD
Message-ID: <7vk60lbnvj.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vk60lbnvj.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <11666916581935-git-send-email-pdmef@gmx.net>

```
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, 2006-12-21 10:09

Subject: Re: [PATCH] Define -D__BSD_VISIBLE for FreeBSD
Message-ID: <20061221100952.GA15424@peter.daprodeges.fqdn.th-h.de>
URL: https://gitlist.dev/e/20061221100952.GA15424%40peter.daprodeges.fqdn.th-h.de
In-Reply-To: <7vk60lbnvj.fsf@assigned-by-dhcp.cox.net>

```
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!

```
