[FFmpeg-devel] [PATCH][RFC] -std=c99
Wed Aug 13 03:54:59 CEST 2008
Aurelien Jacobs wrote:
> Michael Niedermayer wrote:
>> On Tue, Aug 12, 2008 at 11:20:06PM +0100, M?ns Rullg?rd wrote:
>>> Michael Niedermayer <michaelni at gmx.at> writes:
>>>> On Tue, Aug 12, 2008 at 10:47:54PM +0200, Michael Niedermayer wrote:
>>>>> On Tue, Aug 12, 2008 at 08:56:12PM +0100, M?ns Rullg?rd wrote:
>>>>>> Most (all?) of the above-mentioned functions are POSIX standard, so
>>>>>> there should be no need for _BSD_SOURCE. If anything does require
>>>>>> this, we should look for a POSIX alternative.
>>>>> Ill try again with xopen and posix and without bsd
>>>> done, the following works for me too
>>>> lower values of _XOPEN_SOURCE fail with:
>>>> ffserver.c:4474: error: ?SA_RESTART? undeclared (first use in this function)
>>>> lower values of _POSIX_C_SOURCE fail with:
>>>> libavdevice/v4l.c:294: error: storage size of ?ts? isn?t known
>>>> Index: configure
>>>> --- configure (revision 14508)
>>>> +++ configure (working copy)
>>>> @@ -1827,6 +1827,7 @@
>>>> check_cflags -Wwrite-strings
>>>> check_cflags -Wtype-limits
>>>> enabled extra_warnings && check_cflags -Winline
>>>> +check_cflags -std=c99 -fasm -D_POSIX_C_SOURCE=199309 -D_XOPEN_SOURCE=500
>>> I'd just go with -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600.
>> Is there anything that has been added to them that we need?
>> The whole point of my patch is to keep the set of dependancies for ffmpeg
> I agree.
> And in this spirit, have a look at attached patch. It restrict definition
> of _XOPEN_SOURCE to ffserver.c. It also define 3 mathematics constants
> which are not worth defining _XOPEN_SOURCE IMO.
> With this applied, you can simply drop -D_XOPEN_SOURCE=500 from your patch.
> Note that I agree with M?ns that the -D flags should be set unconditionally
> instead of in the check_cflags.
> Oh, and did I mentioned that I'm all in favor of this -std=c99 patch ?
I like this approach.
> Index: ffserver.c
> --- ffserver.c (revision 14718)
> +++ ffserver.c (working copy)
> @@ -19,6 +19,8 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> +#define _XOPEN_SOURCE 500
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc. http://www.smartjog.com
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
More information about the ffmpeg-devel