From a7951081f153934cbf93215c5e255b99ec3e1157 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 2 Sep 2008 21:50:08 -0400 Subject: [PATCH] Move _GNU_SOURCE declarations to where it's used Such that we don't rely on more GNU extensions accidentally. --- perf/Makefile.am | 5 ----- perf/cairo-perf-posix.c | 2 ++ perf/cairo-perf.c | 2 ++ test/Makefile.am | 6 ------ test/cairo-test.c | 2 ++ test/invalid-matrix.c | 5 ++++- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/perf/Makefile.am b/perf/Makefile.am index 319d82ea6..aba38a3a7 100644 --- a/perf/Makefile.am +++ b/perf/Makefile.am @@ -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 \ diff --git a/perf/cairo-perf-posix.c b/perf/cairo-perf-posix.c index b1b1a2a71..8bf78cec5 100644 --- a/perf/cairo-perf-posix.c +++ b/perf/cairo-perf-posix.c @@ -53,6 +53,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#define _XOPEN_SOURCE 600 /* for round() */ + #include #include #include diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c index abeab21f3..38c711901 100644 --- a/perf/cairo-perf.c +++ b/perf/cairo-perf.c @@ -26,6 +26,8 @@ * Carl Worth */ +#define _GNU_SOURCE 1 /* for sched_getaffinity() */ + #include "cairo-perf.h" #include "cairo-boilerplate-getopt.h" diff --git a/test/Makefile.am b/test/Makefile.am index 7f8371388..fcc16015a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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) diff --git a/test/cairo-test.c b/test/cairo-test.c index 6c04f8ce5..b29ffb9c9 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -23,6 +23,8 @@ * Author: Carl D. Worth */ +#define _GNU_SOURCE 1 /* for feenableexcept() et al */ + #if HAVE_CONFIG_H #include "config.h" #endif diff --git a/test/invalid-matrix.c b/test/invalid-matrix.c index 8db3df13b..be1133699 100644 --- a/test/invalid-matrix.c +++ b/test/invalid-matrix.c @@ -24,9 +24,12 @@ * Author: Carl Worth */ +#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