mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-05 04:10:07 +02:00
gmain: Add G_PID_FORMAT
This will be useful for printing out GPids in printf()-style functions. https://bugzilla.gnome.org/show_bug.cgi?id=767765
This commit is contained in:
parent
8c6d08ab1b
commit
7ea4949cda
@ -125,6 +125,7 @@ case "$host" in
|
|||||||
*-*-mingw*)
|
*-*-mingw*)
|
||||||
glib_native_win32=yes
|
glib_native_win32=yes
|
||||||
glib_pid_type='void *'
|
glib_pid_type='void *'
|
||||||
|
glib_pid_format='p'
|
||||||
glib_pollfd_format='%#x'
|
glib_pollfd_format='%#x'
|
||||||
glib_cv_stack_grows=no
|
glib_cv_stack_grows=no
|
||||||
# Unfortunately the mingw implementations of C99-style snprintf and vsnprintf
|
# Unfortunately the mingw implementations of C99-style snprintf and vsnprintf
|
||||||
@ -148,6 +149,7 @@ case "$host" in
|
|||||||
*)
|
*)
|
||||||
glib_native_win32=no
|
glib_native_win32=no
|
||||||
glib_pid_type=int
|
glib_pid_type=int
|
||||||
|
glib_pid_format='i'
|
||||||
glib_pollfd_format='%d'
|
glib_pollfd_format='%d'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -2884,6 +2886,7 @@ _______EOF
|
|||||||
#define G_MODULE_SUFFIX "$g_module_suffix"
|
#define G_MODULE_SUFFIX "$g_module_suffix"
|
||||||
|
|
||||||
typedef $g_pid_type GPid;
|
typedef $g_pid_type GPid;
|
||||||
|
#define G_PID_FORMAT $g_pid_format
|
||||||
|
|
||||||
#define GLIB_SYSDEF_AF_UNIX $g_af_unix
|
#define GLIB_SYSDEF_AF_UNIX $g_af_unix
|
||||||
#define GLIB_SYSDEF_AF_INET $g_af_inet
|
#define GLIB_SYSDEF_AF_INET $g_af_inet
|
||||||
@ -3166,6 +3169,7 @@ g_gcc_atomic_ops="$glib_cv_gcc_has_builtin_atomic_operations"
|
|||||||
|
|
||||||
g_module_suffix="$glib_gmodule_suffix"
|
g_module_suffix="$glib_gmodule_suffix"
|
||||||
g_pid_type="$glib_pid_type"
|
g_pid_type="$glib_pid_type"
|
||||||
|
g_pid_format="\"$glib_pid_format\""
|
||||||
g_pollfd_format="\"$glib_pollfd_format\""
|
g_pollfd_format="\"$glib_pollfd_format\""
|
||||||
|
|
||||||
case $host in
|
case $host in
|
||||||
|
@ -571,6 +571,7 @@ g_idle_remove_by_data
|
|||||||
|
|
||||||
<SUBSECTION>
|
<SUBSECTION>
|
||||||
GPid
|
GPid
|
||||||
|
G_PID_FORMAT
|
||||||
GChildWatchFunc
|
GChildWatchFunc
|
||||||
g_child_watch_source_new
|
g_child_watch_source_new
|
||||||
g_child_watch_add
|
g_child_watch_add
|
||||||
|
@ -242,6 +242,7 @@ typedef unsigned __int64 guintptr;
|
|||||||
* not a process identifier.
|
* not a process identifier.
|
||||||
*/
|
*/
|
||||||
typedef void * GPid;
|
typedef void * GPid;
|
||||||
|
#define G_PID_FORMAT "p"
|
||||||
|
|
||||||
#define GLIB_SYSDEF_AF_UNIX 1
|
#define GLIB_SYSDEF_AF_UNIX 1
|
||||||
#define GLIB_SYSDEF_AF_INET 2
|
#define GLIB_SYSDEF_AF_INET 2
|
||||||
|
11
glib/gmain.h
11
glib/gmain.h
@ -140,6 +140,17 @@ typedef struct _GSourceFuncs GSourceFuncs;
|
|||||||
* GPid is used in GLib only for descendant processes spawned with
|
* GPid is used in GLib only for descendant processes spawned with
|
||||||
* the g_spawn functions.
|
* the g_spawn functions.
|
||||||
*/
|
*/
|
||||||
|
/* defined in glibconfig.h */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* G_PID_FORMAT:
|
||||||
|
*
|
||||||
|
* A format specifier that can be used in printf()-style format strings
|
||||||
|
* when printing a #GPid.
|
||||||
|
*
|
||||||
|
* Since: 2.50
|
||||||
|
*/
|
||||||
|
/* defined in glibconfig.h */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GSourceFunc:
|
* GSourceFunc:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user