[glib/wip/3v1n0/add-darwin-os] meson: Define G_OS_DARWIN when compiling under OSX or iOS
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/3v1n0/add-darwin-os] meson: Define G_OS_DARWIN when compiling under OSX or iOS
- Date: Tue, 18 Oct 2022 20:01:50 +0000 (UTC)
commit 53fc954d86c1d733f6738ce308c7c43a107cc476
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Tue Oct 18 21:59:59 2022 +0200
meson: Define G_OS_DARWIN when compiling under OSX or iOS
It has enough differences to expose it as an unix-subtype.
docs/reference/glib/glib-sections.txt.in | 1 +
glib/docs.c | 11 +++++++++++
meson.build | 3 +++
3 files changed, 15 insertions(+)
---
diff --git a/docs/reference/glib/glib-sections.txt.in b/docs/reference/glib/glib-sections.txt.in
index 35a20efcbc..90b0f32585 100644
--- a/docs/reference/glib/glib-sections.txt.in
+++ b/docs/reference/glib/glib-sections.txt.in
@@ -140,6 +140,7 @@ GLIB_VERSION_PREV_STABLE
<TITLE>Standard Macros</TITLE>
<FILE>macros</FILE>
<SUBSECTION>
+G_OS_DARWIN
G_OS_WIN32
G_OS_UNIX
diff --git a/glib/docs.c b/glib/docs.c
index a8e31fb873..968d2e20f5 100644
--- a/glib/docs.c
+++ b/glib/docs.c
@@ -1647,6 +1647,17 @@
* These macros provide a few commonly-used features.
*/
+/**
+ * G_OS_DARWIN:
+ *
+ * This macro is defined only on Mac OS (OSX or iOS). So you can bracket
+ * -specific code in "\#ifdef G_OS_DARWIN".
+ *
+ * Note that %G_OS_UNIX is also set.
+ *
+ * Since: 2.76
+ */
+
/**
* G_OS_WIN32:
*
diff --git a/meson.build b/meson.build
index ddcdc028d4..bd30f53d7a 100644
--- a/meson.build
+++ b/meson.build
@@ -235,6 +235,9 @@ if host_system == 'windows'
elif host_system == 'cygwin'
glib_os = '''#define G_OS_UNIX
#define G_WITH_CYGWIN'''
+elif host_system == 'darwin'
+ glib_os = '''#define G_OS_UNIX
+#define G_OS_DARWIN'''
else
glib_os = '#define G_OS_UNIX'
endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]