[gnome-software/gnome-3-30] build: Define _GNU_SOURCE globally



commit 108819842a91a4097450cfeef786e61bf496d20e
Author: Kalev Lember <klember redhat com>
Date:   Tue Sep 25 11:18:19 2018 +0200

    build: Define _GNU_SOURCE globally
    
    This avoids having to set it in each source file individually. In
    particular, I'd like to avoid changing lib/gs-ioprio.c that's imported
    from tracker.
    
    Fixes the following compiler warning:
    
    ../lib/gs-ioprio.c: In function ‘ioprio_set’:
    ../lib/gs-ioprio.c:107:9: warning: implicit declaration of function ‘syscall’; did you mean ‘strcoll’? 
[-Wimplicit-function-declaration]

 meson.build                           | 2 ++
 plugins/core/gs-plugin-icons.c        | 1 -
 plugins/epiphany/gs-plugin-epiphany.c | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 12935062..eb906247 100644
--- a/meson.build
+++ b/meson.build
@@ -91,6 +91,8 @@ add_global_link_arguments(
 
 # Needed for PATH_MAX and symlink()
 add_project_arguments('-D_XOPEN_SOURCE=700', language : 'c')
+# Needed for syscall()
+add_project_arguments('-D_GNU_SOURCE', language : 'c')
 
 conf.set('HAVE_LINUX_UNISTD_H', cc.has_header('linux/unistd.h'))
 
diff --git a/plugins/core/gs-plugin-icons.c b/plugins/core/gs-plugin-icons.c
index 2a4681c8..164492f8 100644
--- a/plugins/core/gs-plugin-icons.c
+++ b/plugins/core/gs-plugin-icons.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#define _GNU_SOURCE
 #include <string.h>
 
 #include <gnome-software.h>
diff --git a/plugins/epiphany/gs-plugin-epiphany.c b/plugins/epiphany/gs-plugin-epiphany.c
index 9cb3f56a..44e2e5bd 100644
--- a/plugins/epiphany/gs-plugin-epiphany.c
+++ b/plugins/epiphany/gs-plugin-epiphany.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#define _GNU_SOURCE
 #include <string.h>
 
 #include <gnome-software.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]