mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Autoconf apparently gives us a nice define for processor endianess.
This commit is contained in:
parent
39ac20fc2d
commit
98bea094b3
|
@ -67,13 +67,7 @@ uint32_t id_copy(uint8_t *dest, uint8_t *src)
|
|||
|
||||
void host_to_net(uint8_t *num, uint16_t numbytes)
|
||||
{
|
||||
union {
|
||||
uint32_t i;
|
||||
uint8_t c[4];
|
||||
} a;
|
||||
a.i = 1;
|
||||
|
||||
if (a.c[0] == 1) {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
uint32_t i;
|
||||
uint8_t buff[numbytes];
|
||||
|
||||
|
@ -82,7 +76,8 @@ void host_to_net(uint8_t *num, uint16_t numbytes)
|
|||
}
|
||||
|
||||
memcpy(num, buff, numbytes);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
/* state load/save */
|
||||
|
|
Loading…
Reference in New Issue
Block a user