Move G_POLLFD_FORMAT to glibconfig.h

It's a platform-specific macro, so it belongs in glibconfig.h.
This ensures that g-ir-scanner will not pick the wrong definition
for introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=757294
This commit is contained in:
Mikhail Zabaluev 2015-10-29 10:54:34 +02:00
parent 6f1b574cea
commit 0dbc81c73a
3 changed files with 13 additions and 10 deletions

View File

@ -125,6 +125,7 @@ case "$host" in
*-*-mingw*)
glib_native_win32=yes
glib_pid_type='void *'
glib_pollfd_format='%#x'
glib_cv_stack_grows=no
# Unfortunately the mingw implementations of C99-style snprintf and vsnprintf
# don't seem to be quite good enough, at least not in mingw-runtime-3.14.
@ -138,6 +139,7 @@ case "$host" in
case "$host" in
x86_64-*-*)
LIB_EXE_MACHINE_FLAG=X64
glib_pollfd_format='%#I64x'
;;
esac
@ -146,6 +148,7 @@ case "$host" in
*)
glib_native_win32=no
glib_pid_type=int
glib_pollfd_format='%d'
;;
esac
case $host in
@ -2866,6 +2869,8 @@ typedef gint64 goffset;
#define G_GOFFSET_FORMAT G_GINT64_FORMAT
#define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val)
#define G_POLLFD_FORMAT $g_pollfd_format
_______EOF
if test -z "$glib_unknown_void_p"; then
@ -3333,8 +3338,9 @@ g_memory_barrier_needed="$glib_memory_barrier_needed"
g_gcc_atomic_ops="$glib_cv_gcc_has_builtin_atomic_operations"
g_module_suffix="$glib_gmodule_suffix"
g_pid_type="$glib_pid_type"
g_pollfd_format="\"$glib_pollfd_format\""
case $host in
*-*-cygwin*)
glib_os="#define G_OS_UNIX

View File

@ -115,6 +115,8 @@ typedef gint64 goffset;
#ifndef _WIN64
#define G_POLLFD_FORMAT "%#x"
#define GPOINTER_TO_INT(p) ((gint) (p))
#define GPOINTER_TO_UINT(p) ((guint) (p))
@ -130,6 +132,8 @@ typedef unsigned int guintptr;
#else
#define G_POLLFD_FORMAT "%#I64x"
#define GPOINTER_TO_INT(p) ((gint) (gint64) (p))
#define GPOINTER_TO_UINT(p) ((guint) (guint64) (p))

View File

@ -22,6 +22,7 @@
#error "Only <glib.h> can be included directly."
#endif
#include <glibconfig.h>
#include <glib/gtypes.h>
G_BEGIN_DECLS
@ -106,15 +107,7 @@ struct _GPollFD
* A format specifier that can be used in printf()-style format strings
* when printing the @fd member of a #GPollFD.
*/
#ifdef G_OS_WIN32
#if GLIB_SIZEOF_VOID_P == 8
#define G_POLLFD_FORMAT "%#I64x"
#else
#define G_POLLFD_FORMAT "%#x"
#endif
#else
#define G_POLLFD_FORMAT "%d"
#endif
/* defined in glibconfig.h */
GLIB_AVAILABLE_IN_ALL
gint