mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-02 07:36:17 +01:00
d0219f2597
Add some helpers for builds-checked unsigned integer arithmetic to GLib. These will be based on compiler intrinsics where they are available, falling back to standard manual checks otherwise. The fallback case needs to be implemented as a function (which we do inline) because we cannot rely on statement expressions. We also implement the intrinsics case as an inline in order to avoid people accidentally writing non-portable code which depends on static evaluation of the builtin. For now there is only support for addition and multiplication for guint, guint64 and gsize. It may make sense to add support for subtraction or for the signed equivalents of those types in the future if we find a use for that. https://bugzilla.gnome.org/show_bug.cgi?id=503096 |
||
---|---|---|
.. | ||
reference | ||
debugging.txt | ||
macros.txt | ||
Makefile.am |