From f73ad4ab05aaf35cd720dffbdc47c28d35d609e1 Mon Sep 17 00:00:00 2001 From: irungentoo_trip Date: Fri, 24 Oct 2014 18:04:27 -0700 Subject: Portability saving fixes for big endian systems. Saves should now be portable from big endian to little endian systems though I need someone to actually test it to be sure I didn't mess up. --- toxcore/util.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'toxcore/util.h') diff --git a/toxcore/util.h b/toxcore/util.h index 7992a985..e90eee0f 100644 --- a/toxcore/util.h +++ b/toxcore/util.h @@ -42,6 +42,11 @@ uint32_t id_copy(uint8_t *dest, const uint8_t *src); /* return value is CLIENT_I void host_to_net(uint8_t *num, uint16_t numbytes); #define net_to_host(x, y) host_to_net(x, y) +uint16_t lendian_to_host16(uint16_t lendian); +#define host_tolendian16(x) lendian_to_host16(x) + +void host_to_lendian32(uint8_t *dest, uint32_t num); + /* state load/save */ typedef int (*load_state_callback_func)(void *outer, const uint8_t *data, uint32_t len, uint16_t type); int load_state(load_state_callback_func load_state_callback, void *outer, -- cgit v1.2.3