Go to the documentation of this file. 56 #ifndef LWIP_HDR_ARCH_H 57 #define LWIP_HDR_ARCH_H 60 #define LITTLE_ENDIAN 1234 64 #define BIG_ENDIAN 4321 84 #define BYTE_ORDER LITTLE_ENDIAN 89 #define LWIP_RAND() ((u32_t)rand()) 97 #ifndef LWIP_PLATFORM_DIAG 98 #define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) 108 #ifndef LWIP_PLATFORM_ASSERT 109 #define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \ 110 x, __LINE__, __FILE__); fflush(NULL); abort();} while(0) 119 #ifndef LWIP_NO_STDDEF_H 120 #define LWIP_NO_STDDEF_H 0 123 #if !LWIP_NO_STDDEF_H 131 #ifndef LWIP_NO_STDINT_H 132 #define LWIP_NO_STDINT_H 0 136 #if !LWIP_NO_STDINT_H 138 typedef uint8_t u8_t;
140 typedef uint16_t u16_t;
141 typedef int16_t s16_t;
142 typedef uint32_t u32_t;
143 typedef int32_t s32_t;
144 typedef uintptr_t mem_ptr_t;
151 #ifndef LWIP_NO_INTTYPES_H 152 #define LWIP_NO_INTTYPES_H 0 156 #if !LWIP_NO_INTTYPES_H 157 #include <inttypes.h> 159 #define X8_F "02" PRIx8 180 #define SZT_F PRIuPTR 188 #ifndef LWIP_NO_LIMITS_H 189 #define LWIP_NO_LIMITS_H 0 193 #if !LWIP_NO_LIMITS_H 198 #ifndef LWIP_CONST_CAST 199 #define LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val)) 203 #ifndef LWIP_ALIGNMENT_CAST 204 #define LWIP_ALIGNMENT_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) 210 #ifndef LWIP_PTR_NUMERIC_CAST 211 #define LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val) 224 #ifndef LWIP_DECLARE_MEMORY_ALIGNED 225 #define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)] 232 #ifndef LWIP_MEM_ALIGN_SIZE 233 #define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) & ~(MEM_ALIGNMENT-1U)) 240 #ifndef LWIP_MEM_ALIGN_BUFFER 241 #define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1U)) 247 #ifndef LWIP_MEM_ALIGN 248 #define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1))) 260 #ifndef PACK_STRUCT_BEGIN 261 #define PACK_STRUCT_BEGIN 269 #ifndef PACK_STRUCT_END 270 #define PACK_STRUCT_END 278 #ifndef PACK_STRUCT_STRUCT 279 #if defined(__GNUC__) || defined(__clang__) 280 #define PACK_STRUCT_STRUCT __attribute__((packed)) 282 #define PACK_STRUCT_STRUCT 291 #ifndef PACK_STRUCT_FIELD 292 #define PACK_STRUCT_FIELD(x) x 300 #ifndef PACK_STRUCT_FLD_8 301 #define PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x) 309 #ifndef PACK_STRUCT_FLD_S 310 #define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x) 322 #define PACK_STRUCT_USE_INCLUDES 326 #ifndef LWIP_UNUSED_ARG 327 #define LWIP_UNUSED_ARG(x) (void)x