mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-14 19:48:05 +02: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 <sys/types.h>
|
||||||
#include <pwd.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
|
* SECTION:gunix
|
||||||
* @title: UNIX-specific utilities and integration
|
* @title: UNIX-specific utilities and integration
|
||||||
|
Loading…
x
Reference in New Issue
Block a user