Merge branch '77-wrap-on-linux' into 'master'

glib: Rename G_STDIO_NO_WRAP_ON_UNIX → G_STDIO_WRAP_ON_UNIX

Closes #77

See merge request GNOME/glib!830
This commit is contained in:
Philip Withnall 2019-06-11 11:37:35 +00:00
commit 9740b58814
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