mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 07:26:15 +01:00
Merge branch 'wip/smcv/os-detect' into 'main'
docs: Mention platform-specific predefined macros See merge request GNOME/glib!2997
This commit is contained in:
commit
110cddb90c
16
glib/docs.c
16
glib/docs.c
@ -2020,6 +2020,22 @@
|
||||
*
|
||||
* This macro is defined only on UNIX. So you can bracket
|
||||
* UNIX-specific code in "\#ifdef G_OS_UNIX".
|
||||
*
|
||||
* To detect whether to compile features that require a specific kernel
|
||||
* or operating system, check for the appropriate OS-specific predefined
|
||||
* macros instead, for example:
|
||||
*
|
||||
* - Linux kernel (any libc, including glibc, musl or Android): `\#ifdef __linux__`
|
||||
* - Linux kernel and GNU user-space: `\#if defined(__linux__) && defined(__GLIBC__)`
|
||||
* - FreeBSD kernel (any libc, including glibc): `\#ifdef __FreeBSD_kernel__`
|
||||
* - FreeBSD kernel and user-space: `\#ifdef __FreeBSD__`
|
||||
*
|
||||
* See <https://sourceforge.net/p/predef/wiki/OperatingSystems/> for more.
|
||||
*
|
||||
* GLib defines OS-detection macros for some categories of systems
|
||||
* that can be less straightforward to detect, such as %G_OS_DARWIN, but
|
||||
* intentionally does not provide its own equivalents of macros like
|
||||
* `__linux__`.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user