mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 20:46:14 +01:00
girparser: Add a pseudo-doc-comment for signedness()
We could consider adding this to gmacros if it's useful anywhere else. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
c7e0f3e6b8
commit
d9ee53d0eb
@ -454,6 +454,12 @@ typedef struct {
|
||||
unsigned int is_signed : 1;
|
||||
} IntegerAliasInfo;
|
||||
|
||||
/*
|
||||
* signedness:
|
||||
* @T: a numeric type
|
||||
*
|
||||
* Returns: 1 if @T is signed, 0 if it is unsigned
|
||||
*/
|
||||
#define signedness(T) (((T) -1) <= 0)
|
||||
G_STATIC_ASSERT (signedness (int) == 1);
|
||||
G_STATIC_ASSERT (signedness (unsigned int) == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user