[gnome-software] build: Define _GNU_SOURCE globally
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] build: Define _GNU_SOURCE globally
- Date: Tue, 25 Sep 2018 09:27:20 +0000 (UTC)
commit a5f7b4e448fc4f3b025b14961abf388840d5bcaa
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 476289f9..69d72442 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]