[FFmpeg-devel] [PATCH][RFC] -std=c99

Måns Rullgård mans
Thu Aug 21 17:40:55 CEST 2008

Luca Abeni wrote:
> Hi M?ns,
> M?ns Rullg?rd wrote:
> [...]
>>> 4) I believe that adding "#define _BSD_SOURCE" at the top of udp.c (before
>>>     all the "#include"s) should fix the compilation (can anyone test? I do
>>>     not see the compilation failure, so I cannot test). And asking fro BSD
>>>     compatibility when using sockets looks like a good idea, so I think
>>>     this could be an acceptable solution...
>>> Ideas/comments?
>> It seems this is the only sensible option we have.  The one thing I don't
>> like about it is that by messing with reserved namespace (_BSD_SOURCE),
>> we are invoking undefined behaviour.  There is no telling what some other
>> libc might do if this is defined.
> Uhmmm... Maybe we can do something like:
> #ifdef __GLIBC__
> #define _BSD_SOURCE
> #endif

That won't work.  _BSD_SOURCE must be defined before any header is
included, and __GLIBC__ won't be defined until after.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list