On Fri, 22 Apr 2011, Måns Rullgård wrote:

> Martin Storsjö <[email protected]> writes:
> 
> > On Fri, 22 Apr 2011, Måns Rullgård wrote:
> >
> >> __BSD_VISIBLE should not be set directly, IIRC.  _BSD_SOURCE is the
> >> correct symbol to define.  This can be done with add_cppflags -D_BSD_SOURCE
> >> in the relevant OS sections in configure.
> >
> > Yes, the *_VISIBLE macros sound like things that shouldn't be set 
> > manually. Nevertheless, defining _BSD_SOURCE isn't enough for getting the 
> > inet_aton prototype on DragonFly at least.
> 
> Then find the right thing to define.

As far as I can see, there's nothing else you can define to make it work, 
except undefining _POSIX_C_SOURCE. Here's the relevant parts of 
sys/cdefs.h 
(http://gitweb.dragonflybsd.org/dragonfly.git/blob?f=sys/sys/cdefs.h):

#ifdef _POSIX_C_SOURCE
/* ...
 * Checking exact version of _POSIX_C_SOURCE, never setting __BSD_VISIBLE 
 */
#else
/* ...
 * If a program mistakenly defines _ANSI_SOURCE and some other macro such 
as
 * _POSIX_C_SOURCE, we will assume that it wants the broader compilation
 * environment (and in fact we will never get here).
 */
#ifdef _ANSI_SOURCE             /* Hide almost everything. */
#define __POSIX_VISIBLE         0
#define __XSI_VISIBLE           0
#define __BSD_VISIBLE           0
#define __ISO_C_VISIBLE         1990
#elif defined(_C99_SOURCE)      /* Localism to specify strict C99 env. */
#define __POSIX_VISIBLE         0
#define __XSI_VISIBLE           0
#define __BSD_VISIBLE           0
#define __ISO_C_VISIBLE         1999
#else                           /* Default environment: show everything. 
*/
#define __POSIX_VISIBLE         200112
#define __XSI_VISIBLE           600
#define __BSD_VISIBLE           1
#define __ISO_C_VISIBLE         1999
#endif

#endif

This is the only place __BSD_VISIBLE is set under /usr/include as far as I 
can see, and as long as _POSIX_C_SOURCE is defined, it will never be 
defined. And __BSD_VISIBLE is required for inet_aton to be visible: 
http://gitweb.dragonflybsd.org/dragonfly.git/blob?f=include/arpa/inet.h

Didn't perform the same check for FreeBSD yet, though...

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to