mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
meson: Define G_OS_DARWIN when compiling under OSX or iOS
It has enough differences to expose it as an unix-subtype.
This commit is contained in:
parent
4b6cc2d87b
commit
e85635daa0
@ -196,6 +196,11 @@ GCond *cond
|
||||
|
||||
# Definitions for different operating systems
|
||||
|
||||
<MACRO>
|
||||
<NAME>G_OS_DARWIN</NAME>
|
||||
#define G_OS_DARWIN
|
||||
</MACRO>
|
||||
|
||||
<MACRO>
|
||||
<NAME>G_OS_UNIX</NAME>
|
||||
#define G_OS_UNIX
|
||||
|
@ -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
|
||||
|
||||
|
11
glib/docs.c
11
glib/docs.c
@ -1647,6 +1647,17 @@
|
||||
* These macros provide a few commonly-used features.
|
||||
*/
|
||||
|
||||
/**
|
||||
* G_OS_DARWIN:
|
||||
*
|
||||
* This macro is defined only on Apple operating systems (macOS or iOS).
|
||||
* So you can bracket Apple-specific code in `\#ifdef G_OS_DARWIN`.
|
||||
*
|
||||
* Note that %G_OS_UNIX is also set.
|
||||
*
|
||||
* Since: 2.76
|
||||
*/
|
||||
|
||||
/**
|
||||
* G_OS_WIN32:
|
||||
*
|
||||
|
@ -20,8 +20,19 @@
|
||||
* Author: Philip Withnall <withnall@endlessm.com>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#if defined (__APPLE__) || defined (HAVE_COCOA) || defined (HAVE_CARBON)
|
||||
# ifndef G_OS_UNIX
|
||||
G_STATIC_ASSERT (FALSE);
|
||||
# endif
|
||||
# ifndef G_OS_DARWIN
|
||||
G_STATIC_ASSERT (FALSE);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Test that G_STATIC_ASSERT_EXPR can be used as an expression */
|
||||
static void
|
||||
test_assert_static (void)
|
||||
|
@ -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 in ['darwin', 'ios']
|
||||
glib_os = '''#define G_OS_UNIX
|
||||
#define G_OS_DARWIN'''
|
||||
else
|
||||
glib_os = '#define G_OS_UNIX'
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user