diff options
author | irungentoo_trip <irungentoo@gmail.com> | 2014-10-24 18:04:27 -0700 |
---|---|---|
committer | irungentoo_trip <irungentoo@gmail.com> | 2014-10-24 18:04:27 -0700 |
commit | f73ad4ab05aaf35cd720dffbdc47c28d35d609e1 (patch) | |
tree | 6a8b49d1469ce4a341b9fca940dcf615568d7438 /toxcore/util.h | |
parent | 31c17856b8ba6c286cb86a2f7284bf4430eea01d (diff) |
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.
Diffstat (limited to 'toxcore/util.h')
-rw-r--r-- | toxcore/util.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 | |||
42 | void host_to_net(uint8_t *num, uint16_t numbytes); | 42 | void host_to_net(uint8_t *num, uint16_t numbytes); |
43 | #define net_to_host(x, y) host_to_net(x, y) | 43 | #define net_to_host(x, y) host_to_net(x, y) |
44 | 44 | ||
45 | uint16_t lendian_to_host16(uint16_t lendian); | ||
46 | #define host_tolendian16(x) lendian_to_host16(x) | ||
47 | |||
48 | void host_to_lendian32(uint8_t *dest, uint32_t num); | ||
49 | |||
45 | /* state load/save */ | 50 | /* state load/save */ |
46 | typedef int (*load_state_callback_func)(void *outer, const uint8_t *data, uint32_t len, uint16_t type); | 51 | typedef int (*load_state_callback_func)(void *outer, const uint8_t *data, uint32_t len, uint16_t type); |
47 | int load_state(load_state_callback_func load_state_callback, void *outer, | 52 | int load_state(load_state_callback_func load_state_callback, void *outer, |