docs: Fix some backslash escaping issues in doc comments

None of these comments have been ported to gi-docgen format properly
yet, but let’s at least fix the backslash escaping so that
`G_DIR_SEPARATOR_S` can be documented usefully.

A full port of this file to gi-docgen format can happen in future.

Spotted on
https://discourse.gnome.org/t/escaped-char-in-glib-dir-separator-s-doc/25607.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-12-12 13:52:11 +00:00
parent ad3e0a6597
commit 553b026aa5
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -856,25 +856,25 @@
* G_OS_WIN32: * G_OS_WIN32:
* *
* This macro is defined only on Windows. So you can bracket * This macro is defined only on Windows. So you can bracket
* Windows-specific code in "\#ifdef G_OS_WIN32". * Windows-specific code in `#ifdef G_OS_WIN32`.
*/ */
/** /**
* G_OS_UNIX: * G_OS_UNIX:
* *
* This macro is defined only on UNIX. So you can bracket * This macro is defined only on UNIX. So you can bracket
* UNIX-specific code in "\#ifdef G_OS_UNIX". * UNIX-specific code in `#ifdef G_OS_UNIX`.
* *
* To detect whether to compile features that require a specific kernel * To detect whether to compile features that require a specific kernel
* or operating system, check for the appropriate OS-specific predefined * or operating system, check for the appropriate OS-specific predefined
* macros instead, for example: * macros instead, for example:
* *
* - Linux kernel (any libc, including glibc, musl or Android): `\#ifdef __linux__` * - Linux kernel (any libc, including glibc, musl or Android): `#ifdef __linux__`
* - Linux kernel and GNU user-space: `\#if defined(__linux__) && defined(__GLIBC__)` * - Linux kernel and GNU user-space: `#if defined(__linux__) && defined(__GLIBC__)`
* - FreeBSD kernel (any libc, including glibc): `\#ifdef __FreeBSD_kernel__` * - FreeBSD kernel (any libc, including glibc): `#ifdef __FreeBSD_kernel__`
* - FreeBSD kernel and user-space: `\#ifdef __FreeBSD__` * - FreeBSD kernel and user-space: `#ifdef __FreeBSD__`
* - Apple operating systems (macOS, iOS, tvOS), regardless of whether * - Apple operating systems (macOS, iOS, tvOS), regardless of whether
* Cocoa/Carbon toolkits are available: `\#ifdef __APPLE__` * Cocoa/Carbon toolkits are available: `#ifdef __APPLE__`
* *
* See <https://sourceforge.net/p/predef/wiki/OperatingSystems/> for more. * See <https://sourceforge.net/p/predef/wiki/OperatingSystems/> for more.
*/ */
@ -883,23 +883,26 @@
* G_DIR_SEPARATOR: * G_DIR_SEPARATOR:
* *
* The directory separator character. * The directory separator character.
* This is '/' on UNIX machines and '\' under Windows. *
* This is `'/'` on UNIX machines and `'\'` under Windows.
*/ */
/** /**
* G_DIR_SEPARATOR_S: * G_DIR_SEPARATOR_S:
* *
* The directory separator as a string. * The directory separator as a string.
* This is "/" on UNIX machines and "\" under Windows. *
* This is `"/"` on UNIX machines and `"\"` under Windows.
*/ */
/** /**
* G_IS_DIR_SEPARATOR: * G_IS_DIR_SEPARATOR:
* @c: a character * @c: a character
* *
* Checks whether a character is a directory * Checks whether a character is a directory separator.
* separator. It returns %TRUE for '/' on UNIX *
* machines and for '\' or '/' under Windows. * It returns true for `'/'` on UNIX machines and for `'\'` or `'/'` under
* Windows.
* *
* Since: 2.6 * Since: 2.6
*/ */