[glib/wip/3v1n0/more-unix-oses: 2/5] meson: Define G_OS_LINUX when host system is Linux
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/3v1n0/more-unix-oses: 2/5] meson: Define G_OS_LINUX when host system is Linux
- Date: Wed, 19 Oct 2022 15:02:20 +0000 (UTC)
commit 21da881a8beb1816432599134197b2afac593add
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Wed Oct 19 15:33:42 2022 +0200
meson: Define G_OS_LINUX when host system is Linux
We happen to have some linux-only code also in generic unix
code, so expose it as an OS macro and unix-subtype.
glib/docs.c | 11 +++++++++++
meson.build | 4 +++-
2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/glib/docs.c b/glib/docs.c
index e2d164625b..0a671bb9ed 100644
--- a/glib/docs.c
+++ b/glib/docs.c
@@ -1658,6 +1658,17 @@
* Since: 2.76
*/
+/**
+ * G_OS_LINUX:
+ *
+ * This macro is defined only on Linux operating systems. So you can bracket
+ * Linux-specific code in `\#ifdef G_OS_LINUX`.
+ *
+ * Note that %G_OS_UNIX is also set.
+ *
+ * Since: 2.76
+ */
+
/**
* G_OS_WIN32:
*
diff --git a/meson.build b/meson.build
index cd9c88e4a4..d4f2610bff 100644
--- a/meson.build
+++ b/meson.build
@@ -237,7 +237,9 @@ if host_system == 'windows'
else
glib_os = ['G_OS_UNIX']
- if host_system == 'cygwin'
+ if host_system == 'linux'
+ glib_os += 'G_OS_LINUX'
+ elif host_system == 'cygwin'
glib_os += 'G_WITH_CYGWIN'
elif host_system == 'darwin'
glib_os += 'G_OS_DARWIN'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]