]> git.sesse.net Git - x264/commitdiff
configure: Define feature test macros for --std=gnu99
authorHenrik Gramner <henrik@gramner.com>
Sun, 31 Jan 2016 19:21:01 +0000 (20:21 +0100)
committerHenrik Gramner <henrik@gramner.com>
Mon, 11 Apr 2016 14:58:23 +0000 (16:58 +0200)
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.

common/cpu.c
common/set.c
configure
encoder/analyse.c
encoder/ratecontrol.c
x264.c

index afda3a77e096b90cafdde5f2b60d79f1a0d0ce3c..1c9894d70c9354826f24f432b573597235119479 100644 (file)
@@ -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"
 
index 815465108d5e6c3feb6b8d5ed99591f91d550bcd..78535510307a720602f58a80cd9c727d579c5f87 100644 (file)
@@ -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))
index 0d40a927f071091623ff2ebb48abb0a0aec05b57..361a7ef9b3b1b6770312ac106796caf6af89ae60 100755 (executable)
--- 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
index 2bb67ad674859de2fdba4457d0c3ffe9cc0e8214..4a2d8a2f1ec9c1b42e05e05558719157ac8f8752 100644 (file)
@@ -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"
index 22eddb0c8ee05109da3acf292376510350c0b88b..436f35501707b347eea10131a1e5b5a61d5e8e43 100644 (file)
@@ -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 18a3e3695a2f6f738239abb6ec264f3ef31283b0..b95207192b76d891fa114b37deec3db617e425b2 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -38,7 +38,6 @@
 #endif
 
 #include <signal.h>
-#define _GNU_SOURCE
 #include <getopt.h>
 #include "common/common.h"
 #include "x264cli.h"