mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-29 18:27:15 +02:00
IDF release/v4.0 08219f3cf
This commit is contained in:
@ -30,6 +30,7 @@
|
||||
#define _ENDIAN_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include "byteswap.h"
|
||||
|
||||
#ifndef BIG_ENDIAN
|
||||
@ -82,9 +83,7 @@ typedef __uint64_t uint64_t;
|
||||
* Host to big endian, host to little endian, big endian to host, and little
|
||||
* endian to host byte order functions as detailed in byteorder(9).
|
||||
*/
|
||||
#if 1 //BYTE_ORDER == _LITTLE_ENDIAN
|
||||
#define __bswap16 __bswap_16
|
||||
#define __bswap32 __bswap_32
|
||||
#if BYTE_ORDER == _LITTLE_ENDIAN
|
||||
#define htobe16(x) bswap16((x))
|
||||
#define htobe32(x) bswap32((x))
|
||||
#define htobe64(x) bswap64((x))
|
||||
@ -99,10 +98,6 @@ typedef __uint64_t uint64_t;
|
||||
#define le32toh(x) ((uint32_t)(x))
|
||||
#define le64toh(x) ((uint64_t)(x))
|
||||
|
||||
#ifndef htons
|
||||
#define htons htobe16
|
||||
#endif //htons
|
||||
|
||||
#else /* _BYTE_ORDER != _LITTLE_ENDIAN */
|
||||
#define htobe16(x) ((uint16_t)(x))
|
||||
#define htobe32(x) ((uint32_t)(x))
|
||||
|
Reference in New Issue
Block a user