From: Henrik Gramner Date: Sun, 31 Jan 2016 19:21:01 +0000 (+0100) Subject: configure: Define feature test macros for --std=gnu99 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5be32efc244d96aa56be462664b5c56d7318e86d;p=x264 configure: Define feature test macros for --std=gnu99 Makes the printf() family functions on MinGW use the correct C99 POSIX versions instead of the broken pre-VS2015 Microsoft ones. Also allows us to get rid of some _GNU_SOURCE and _ISOC99_SOURCE defines. --- diff --git a/common/cpu.c b/common/cpu.c index afda3a77..1c9894d7 100644 --- a/common/cpu.c +++ b/common/cpu.c @@ -25,7 +25,6 @@ * For more information, contact us at licensing@x264.com. *****************************************************************************/ -#define _GNU_SOURCE // for sched_getaffinity #include "common.h" #include "cpu.h" diff --git a/common/set.c b/common/set.c index 81546510..78535510 100644 --- a/common/set.c +++ b/common/set.c @@ -23,7 +23,6 @@ * For more information, contact us at licensing@x264.com. *****************************************************************************/ -#define _ISOC99_SOURCE #include "common.h" #define SHIFT(x,s) ((s)<=0 ? (x)<<-(s) : ((x)+(1<<((s)-1)))>>(s)) diff --git a/configure b/configure index 0d40a927..361a7ef9 100755 --- a/configure +++ b/configure @@ -806,7 +806,7 @@ cc_check || die "No working C compiler found." if [ $compiler_style = GNU ]; then if cc_check '' -std=gnu99 'for( int i = 0; i < 9; i++ );' ; then - CFLAGS="$CFLAGS -std=gnu99" + CFLAGS="$CFLAGS -std=gnu99 -D_POSIX_C_SOURCE=200112L -D_GNU_SOURCE" elif cc_check '' -std=c99 'for( int i = 0; i < 9; i++ );' ; then CFLAGS="$CFLAGS -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE" elif ! cc_check '' '' 'for( int i = 0; i < 9; i++ );' ; then diff --git a/encoder/analyse.c b/encoder/analyse.c index 2bb67ad6..4a2d8a2f 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -25,8 +25,6 @@ * For more information, contact us at licensing@x264.com. *****************************************************************************/ -#define _ISOC99_SOURCE - #include "common/common.h" #include "macroblock.h" #include "me.h" diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index 22eddb0c..436f3550 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -27,7 +27,6 @@ * For more information, contact us at licensing@x264.com. *****************************************************************************/ -#define _ISOC99_SOURCE #undef NDEBUG // always check asserts, the speed effect is far too small to disable them #include "common/common.h" diff --git a/x264.c b/x264.c index 18a3e369..b9520719 100644 --- a/x264.c +++ b/x264.c @@ -38,7 +38,6 @@ #endif #include -#define _GNU_SOURCE #include #include "common/common.h" #include "x264cli.h"