[x264-devel] configure: Define feature test macros for --std=gnu99

Henrik Gramner git at videolan.org
Tue Apr 12 20:36:14 CEST 2016


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Sun Jan 31 20:21:01 2016 +0100| [5be32efc244d96aa56be462664b5c56d7318e86d] | committer: Henrik Gramner

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.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=5be32efc244d96aa56be462664b5c56d7318e86d
---

 common/cpu.c          |    1 -
 common/set.c          |    1 -
 configure             |    2 +-
 encoder/analyse.c     |    2 --
 encoder/ratecontrol.c |    1 -
 x264.c                |    1 -
 6 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/common/cpu.c b/common/cpu.c
index afda3a7..1c9894d 100644
--- a/common/cpu.c
+++ b/common/cpu.c
@@ -25,7 +25,6 @@
  * For more information, contact us at licensing at 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 8154651..7853551 100644
--- a/common/set.c
+++ b/common/set.c
@@ -23,7 +23,6 @@
  * For more information, contact us at licensing at 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 0d40a92..361a7ef 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 2bb67ad..4a2d8a2 100644
--- a/encoder/analyse.c
+++ b/encoder/analyse.c
@@ -25,8 +25,6 @@
  * For more information, contact us at licensing at 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 22eddb0..436f355 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -27,7 +27,6 @@
  * For more information, contact us at licensing at 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 18a3e36..b952071 100644
--- 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"



More information about the x264-devel mailing list