]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib2.0: Add abs() to int8/int16/int32/ssize_t
authorGustav Hartvigsson <gustav.hartvigsson@gmail.com>
Thu, 2 Jun 2022 09:51:40 +0000 (11:51 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 2 Jun 2022 10:25:11 +0000 (12:25 +0200)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1328

vapi/glib-2.0.vapi

index 47a585cf5939f8f04c5b9c676c8ccd4211fb342a..079d4fa50f9f44e197c3f38bbce4a5c8709c6971 100644 (file)
@@ -442,6 +442,8 @@ public struct ssize_t {
        public static ssize_t max (ssize_t a, ssize_t b);
        [CCode (cname = "CLAMP")]
        public ssize_t clamp (ssize_t low, ssize_t high);
+       [CCode (cname = "ABS")]
+       public ssize_t abs ();
 }
 
 [SimpleType]
@@ -522,6 +524,8 @@ public struct int8 {
        public static int8 max (int8 a, int8 b);
        [CCode (cname = "CLAMP")]
        public int8 clamp (int8 low, int8 high);
+       [CCode (cname = "ABS")]
+       public int8 abs ();
 }
 
 [SimpleType]
@@ -573,6 +577,8 @@ public struct int16 {
        public static int16 max (int16 a, int16 b);
        [CCode (cname = "CLAMP")]
        public int16 clamp (int16 low, int16 high);
+       [CCode (cname = "ABS")]
+       public int16 abs ();
 
        [CCode (cname = "GINT16_TO_BE")]
        public int16 to_big_endian ();
@@ -661,6 +667,8 @@ public struct int32 {
        public static int32 max (int32 a, int32 b);
        [CCode (cname = "CLAMP")]
        public int32 clamp (int32 low, int32 high);
+       [CCode (cname = "ABS")]
+       public int32 abs ();
 
        [CCode (cname = "GINT32_TO_BE")]
        public int32 to_big_endian ();