summaryrefslogtreecommitdiff
path: root/src/libqmi-glib/qmi-utils.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-07-10 21:47:17 +0200
committerAleksander Morgado <aleksander@aleksander.es>2018-07-10 21:49:31 +0200
commiteb9e8f05a5df5006181cb6659b645bbe340a88e3 (patch)
tree8cc6587c8302e4bc222acd841a7e4a0fbde30c0d /src/libqmi-glib/qmi-utils.h
parente28fa182dfb29e4a8489e107267430576f4c7b35 (diff)
libqmi-glib,message: new qmi_message_tlv_read_gfloat_endian()
Instead of breaking the qmi_message_tlv_read_gfloat() API, we leave the method in compat, flagged as deprecated, and we introduce a new method that allows specifying the endianness. See: https://gitlab.freedesktop.org/mobile-broadband/libqmi/issues/1
Diffstat (limited to 'src/libqmi-glib/qmi-utils.h')
-rw-r--r--src/libqmi-glib/qmi-utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libqmi-glib/qmi-utils.h b/src/libqmi-glib/qmi-utils.h
index bd20f7b..3deee6f 100644
--- a/src/libqmi-glib/qmi-utils.h
+++ b/src/libqmi-glib/qmi-utils.h
@@ -685,12 +685,14 @@ __QMI_GDOUBLE_SWAP_LE_BE(gdouble in)
}
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define __QMI_ENDIAN_HOST QMI_ENDIAN_LITTLE
#define __QMI_GFLOAT_TO_LE(val) ((gfloat) (val))
#define __QMI_GFLOAT_TO_BE(val) (__QMI_GFLOAT_SWAP_LE_BE (val))
#define __QMI_GDOUBLE_TO_LE(val) ((gdouble) (val))
#define __QMI_GDOUBLE_TO_BE(val) (__QMI_GDOUBLE_SWAP_LE_BE (val))
#elif G_BYTE_ORDER == G_BIG_ENDIAN
+#define __QMI_ENDIAN_HOST QMI_ENDIAN_BIG
#define __QMI_GFLOAT_TO_LE(val) (__QMI_GFLOAT_SWAP_LE_BE (val))
#define __QMI_GFLOAT_TO_BE(val) ((gfloat) (val))
#define __QMI_GDOUBLE_TO_LE(val) (__QMI_GDOUBLE_SWAP_LE_BE (val))