From: Evan Nemerson Date: Wed, 24 Mar 2010 09:33:39 +0000 (-0700) Subject: glib-2.0: add byte order swap macros X-Git-Tag: 0.8.0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=697192068a4c9f42e5e3b1b7bb6f2c389c389506;p=thirdparty%2Fvala.git glib-2.0: add byte order swap macros Fixes bug 613473. --- diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 7b1b47f16..3421a5d7b 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -418,6 +418,13 @@ public struct uint16 { public static uint16 from_big_endian (uint16 val); [CCode (cname = "GUINT16_FROM_LE")] public static uint16 from_little_endian (uint16 val); + + [CCode (cname = "GUINT16_SWAP_BE_PDP")] + public uint16 swap_big_endian_pdp (); + [CCode (cname = "GUINT16_SWAP_LE_BE")] + public uint16 swap_little_endian_big_endian (); + [CCode (cname = "GUINT16_SWAP_LE_PDP")] + public uint16 swap_little_endian_pdp (); } [SimpleType] @@ -488,6 +495,13 @@ public struct uint32 { public static uint32 from_big_endian (uint32 val); [CCode (cname = "GUINT32_FROM_LE")] public static uint32 from_little_endian (uint32 val); + + [CCode (cname = "GUINT32_SWAP_BE_PDP")] + public uint32 swap_big_endian_pdp (); + [CCode (cname = "GUINT32_SWAP_LE_BE")] + public uint32 swap_little_endian_big_endian (); + [CCode (cname = "GUINT32_SWAP_LE_PDP")] + public uint32 swap_little_endian_pdp (); } [SimpleType] @@ -525,6 +539,9 @@ public struct int64 { public static int64 from_big_endian (int64 val); [CCode (cname = "GINT64_FROM_LE")] public static int64 from_little_endian (int64 val); + + [CCode (cname = "GUINT64_SWAP_LE_BE")] + public uint64 swap_little_endian_big_endian (); } [SimpleType] @@ -1243,6 +1260,8 @@ namespace GLib { PDP_ENDIAN } + public const ByteOrder BYTE_ORDER; + /* Atomic Operations */ namespace AtomicInt {