mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02: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:
@@ -454,6 +454,12 @@ typedef struct {
|
|||||||
unsigned int is_signed : 1;
|
unsigned int is_signed : 1;
|
||||||
} IntegerAliasInfo;
|
} IntegerAliasInfo;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* signedness:
|
||||||
|
* @T: a numeric type
|
||||||
|
*
|
||||||
|
* Returns: 1 if @T is signed, 0 if it is unsigned
|
||||||
|
*/
|
||||||
#define signedness(T) (((T) -1) <= 0)
|
#define signedness(T) (((T) -1) <= 0)
|
||||||
G_STATIC_ASSERT (signedness (int) == 1);
|
G_STATIC_ASSERT (signedness (int) == 1);
|
||||||
G_STATIC_ASSERT (signedness (unsigned int) == 0);
|
G_STATIC_ASSERT (signedness (unsigned int) == 0);
|
||||||
|
Reference in New Issue
Block a user