summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-08-17 15:00:54 +0100
committerSimon McVittie <smcv@debian.org>2014-08-21 09:54:12 +0100
commitd329544e703f3dd95be961e1d3778ee1b0dce81b (patch)
tree4cbd5060d05ba4dd4c87e99ef1306c43c45bea0b
parent2737c67ccefeade89af596700fdfc41d7fcf3588 (diff)
downloadgtk+-d329544e703f3dd95be961e1d3778ee1b0dce81b.tar.gz
Use AC_USE_SYSTEM_EXTENSIONS to get _GNU_SOURCE, _XOPEN_SOURCE etc.
Similar to Bug #684123 in GLib. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=641638 Bug-Debian: https://bugs.debian.org/756476 Reviewed-by: Matthias Clasen
-rw-r--r--configure.ac2
-rw-r--r--gdk/wayland/gdkdevice-wayland.c1
-rw-r--r--gtk/fnmatch.c7
-rw-r--r--gtk/gtkscalebutton.c3
-rw-r--r--gtk/gtksearchenginesimple.c8
-rw-r--r--modules/printbackends/cups/gtkprintbackendcups.c4
6 files changed, 2 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac
index 4406403211..a814abe73f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -227,6 +227,8 @@ LT_INIT([disable-static win32-dll])
# Create libtool early, because it's used in configure
LT_OUTPUT
+# Define _GNU_SOURCE etc. where appropriate, e.g. for strptime() on glibc
+AC_USE_SYSTEM_EXTENSIONS
# Make sure we use 64-bit versions of various file stuff.
AC_SYS_LARGEFILE
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 37c6a94d8a..efe413ab3d 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -15,7 +15,6 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#define _GNU_SOURCE
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/gtk/fnmatch.c b/gtk/fnmatch.c
index e67052b568..87582cab69 100644
--- a/gtk/fnmatch.c
+++ b/gtk/fnmatch.c
@@ -35,13 +35,6 @@
#include <glib.h>
-/* We need to make sure that all constants are defined
- * to properly compile this file
- */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
static gunichar
get_char (const char **str)
{
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index b4bda76656..c979f613f1 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -36,9 +36,6 @@
#include "gtkscalebutton.h"
-#ifndef _WIN32
-#define _GNU_SOURCE
-#endif
#include <math.h>
#include <stdlib.h>
#include <string.h>
diff --git a/gtk/gtksearchenginesimple.c b/gtk/gtksearchenginesimple.c
index 14750584a2..4d8ff2f908 100644
--- a/gtk/gtksearchenginesimple.c
+++ b/gtk/gtksearchenginesimple.c
@@ -21,14 +21,6 @@
#include "config.h"
-/* these must be defined even when HAVE_GNU_FTW is not defined
- * because (really) old versions of GNU libc have ftw.h but do
- * export ftw() and friends only if _XOPEN_SOURCE and _GNU_SOURCE
- * are defined. see bug #444097.
- */
-#define _XOPEN_SOURCE 600
-#define _GNU_SOURCE
-
#ifdef HAVE_FTW_H
#include <ftw.h>
#endif
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index a49bb2d71f..69abd49784 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -17,10 +17,6 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef __linux__
-#define _GNU_SOURCE
-#endif
-
#include "config.h"
#include <ctype.h>
#include <unistd.h>