Move _GNU_SOURCE declarations to where it's used

Such that we don't rely on more GNU extensions accidentally.
This commit is contained in:
Behdad Esfahbod 2008-09-02 21:50:08 -04:00
parent b4cee2bd88
commit a7951081f1
6 changed files with 10 additions and 12 deletions

View file

@ -1,9 +1,4 @@
# We're using _GNU_SOURCE to get the prototype for asprintf. This may
# not be the most portable approach, but it is pragmatic and I'm
# willing to do something cleaner as soon as it causes someone a
# problem.
INCLUDES = \
-D_GNU_SOURCE \
-I$(srcdir) \
-I$(top_srcdir)/boilerplate \
-I$(top_srcdir)/src \

View file

@ -53,6 +53,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#define _XOPEN_SOURCE 600 /* for round() */
#include <signal.h>
#include <sys/time.h>
#include <unistd.h>

View file

@ -26,6 +26,8 @@
* Carl Worth <cworth@cworth.org>
*/
#define _GNU_SOURCE 1 /* for sched_getaffinity() */
#include "cairo-perf.h"
#include "cairo-boilerplate-getopt.h"

View file

@ -825,16 +825,10 @@ check-local:
check_PROGRAMS =
EXTRA_PROGRAMS =
# We're using _GNU_SOURCE to get the prototype for asprintf. This may
# not be the most portable approach, but it is pragmatic and I'm
# willing to do something cleaner as soon as it causes someone a
# problem.
INCLUDES = \
-D_GNU_SOURCE \
-I$(srcdir) \
-I$(srcdir)/pdiff \
-I$(top_srcdir)/boilerplate \
-I$(top_srcdir)/pixman/src \
-I$(top_srcdir)/src \
-I$(top_builddir)/src \
$(CAIRO_CFLAGS)

View file

@ -23,6 +23,8 @@
* Author: Carl D. Worth <cworth@cworth.org>
*/
#define _GNU_SOURCE 1 /* for feenableexcept() et al */
#if HAVE_CONFIG_H
#include "config.h"
#endif

View file

@ -24,9 +24,12 @@
* Author: Carl Worth <cworth@cworth.org>
*/
#define _ISOC99_SOURCE /* for INFINITY */
#define _GNU_SOURCE 1 /* for fedisableeexcept() et al */
#include "cairo-test.h"
#if _XOPEN_SOURCE >= 600 || defined (_ISOC99_SOURCE)
#ifdef INFINITY
#define HAVE_INFINITY 1
#endif