mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
glib-unix: Assert that our portable types correspond to ssize_t and pid_t
If this fails to compile on some particularly bizarre Unix platform, we can relax these assertions; but our expectation is that gssize is POSIX ssize_t, and that on Unix, GPid is POSIX pid_t. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
bd1e2a984e
commit
fca9824978
@ -33,6 +33,12 @@
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
|
||||
G_STATIC_ASSERT (sizeof (ssize_t) == GLIB_SIZEOF_SSIZE_T);
|
||||
G_STATIC_ASSERT (G_ALIGNOF (gssize) == G_ALIGNOF (ssize_t));
|
||||
|
||||
G_STATIC_ASSERT (sizeof (GPid) == sizeof (pid_t));
|
||||
G_STATIC_ASSERT (G_ALIGNOF (GPid) == G_ALIGNOF (pid_t));
|
||||
|
||||
/**
|
||||
* SECTION:gunix
|
||||
* @title: UNIX-specific utilities and integration
|
||||
|
Loading…
Reference in New Issue
Block a user