glib: Rename G_STDIO_NO_WRAP_ON_UNIX → G_STDIO_WRAP_ON_UNIX

This clarifies the meaning a bit. Don’t change the logic associated with
it. Add a few comments to clarify things further.

Based on work done by Emmanuel Fleury.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #77
This commit is contained in:
Philip Withnall 2019-05-10 12:58:56 +01:00
parent 314901309f
commit 9974cec26b
3 changed files with 9 additions and 4 deletions

View File

@ -19,7 +19,9 @@
#include "config.h"
#include "glibconfig.h"
#define G_STDIO_NO_WRAP_ON_UNIX
/* Dont redefine (for example) g_open() to open(), since we actually want to
* define g_open() in this file and export it as a symbol. See gstdio.h. */
#define G_STDIO_WRAP_ON_UNIX
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -54,12 +54,15 @@ typedef struct stat GStatBuf;
#endif
#if defined(G_OS_UNIX) && !defined(G_STDIO_NO_WRAP_ON_UNIX)
#if defined(G_OS_UNIX) && !defined(G_STDIO_WRAP_ON_UNIX)
/* Just pass on to the system functions, so there's no potential for data
* format mismatches, especially with large file interfaces.
* A few functions can't be handled in this way, since they are not defined
* in a portable system header that we could include here.
*
* #G_STDIO_WRAP_ON_UNIX is not public API and its behaviour is not guaranteed
* in future.
*/
#ifndef __GTK_DOC_IGNORE__

View File

@ -28,8 +28,8 @@
#include <glib.h>
/* Test our stdio wrappers here */
#define G_STDIO_NO_WRAP_ON_UNIX
/* Test our stdio wrappers here; this disables redefining (e.g.) g_open() to open() */
#define G_STDIO_WRAP_ON_UNIX
#include <glib/gstdio.h>
#ifdef G_OS_UNIX