aboutsummaryrefslogtreecommitdiff
path: root/stdlib/stdlib.h
diff options
context:
space:
mode:
authorLenard Mollenkopf <glibc@lenardmollenkopf.de>2025-04-08 14:16:54 +0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-04-08 12:51:51 +0000
commit5b132ec2b7712dbc055838b3b538b83ad1196414 (patch)
tree28355a9f14cbf15da68217aba5e3be48169092a2 /stdlib/stdlib.h
parent4fa959d13d21b8f56a43aa0a416100303736c55c (diff)
downloadglibc-5b132ec2b7712dbc055838b3b538b83ad1196414.tar.xz
glibc-5b132ec2b7712dbc055838b3b538b83ad1196414.zip
stdlib: Implement C2Y uabs, ulabs, ullabs and uimaxabs
C2Y adds unsigned versions of the abs functions (see C2Y draft N3467 and proposal N3349). Tested for x86_64. Signed-off-by: Lenard Mollenkopf <glibc@lenardmollenkopf.de>
Diffstat (limited to 'stdlib/stdlib.h')
-rw-r--r--stdlib/stdlib.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 975f5aeb0b..cd4503c761 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -985,6 +985,12 @@ __extension__ extern long long int llabs (long long int __x)
__THROW __attribute__ ((__const__)) __wur;
#endif
+#if __GLIBC_USE (ISOC2Y)
+extern unsigned int uabs (int __x) __THROW __attribute__ ((__const__)) __wur;
+extern unsigned long int ulabs (long int __x) __THROW __attribute__ ((__const__)) __wur;
+__extension__ extern unsigned long long int ullabs (long long int __x)
+ __THROW __attribute__ ((__const__)) __wur;
+#endif
/* Return the `div_t', `ldiv_t' or `lldiv_t' representation
of the value of NUMER over DENOM. */