Commit 5be32efc authored by Henrik Gramner's avatar Henrik Gramner
Browse files

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.
parent c01bf421
......@@ -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"
......
......@@ -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))
......
......@@ -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
......
......@@ -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"
......
......@@ -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"
......
......@@ -38,7 +38,6 @@
#endif
#include <signal.h>
#define _GNU_SOURCE
#include <getopt.h>
#include "common/common.h"
#include "x264cli.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment