1#include <stdint.h>
2
3typedef  uint8_t  u8_t;
4typedef uint16_t u16_t;
5typedef uint32_t u32_t;
6typedef uint64_t u64_t;
7
8typedef  int8_t   s8_t;
9typedef int16_t  s16_t;
10typedef int32_t  s32_t;
11typedef int64_t  s64_t;
12
13typedef uintptr_t mem_ptr_t;
14
15
16#define U16_F "hu"
17#define S16_F "d"
18#define X16_F "hx"
19#define U32_F "u"
20#define S32_F "d"
21#define X32_F "x"
22#define SZT_F "uz"
23
24
25// BYTE_ORDER might be defined by the architecture
26#ifndef BYTE_ORDER
27#if defined(__BYTE_ORDER__)
28#  define BYTE_ORDER __BYTE_ORDER__
29#elif defined(__BIG_ENDIAN)
30#  define BYTE_ORDER BIG_ENDIAN
31#elif defined(__LITTLE_ENDIAN)
32#  define BYTE_ORDER LITTLE_ENDIAN
33#else
34#  error Unable to detemine system endianess
35#endif
36#endif
37
38
39#define LWIP_CHKSUM_ALGORITHM 2
40
41
42//#define PACK_STRUCT_FIELD(x) x __attribute__((packed))
43#define PACK_STRUCT_STRUCT __attribute__((packed))
44#define PACK_STRUCT_BEGIN
45#define PACK_STRUCT_END
46
47
48#if 0
49#define LWIP_PLATFORM_BYTESWAP 1
50#define LWIP_PLATFORM_HTONS(x) ( (((u16_t)(x))>>8) | (((x)&0xFF)<<8) )
51#define LWIP_PLATFORM_HTONL(x) ( (((u32_t)(x))>>24) | (((x)&0xFF0000)>>8) \
52                               | (((x)&0xFF00)<<8) | (((x)&0xFF)<<24) )
53#endif
54
55
56#include <stdio.h>
57#include <stdlib.h>
58/* Plaform specific diagnostic output */
59#define LWIP_PLATFORM_DIAG(x) \
60        do {                  \
61            printf x;         \
62            fflush(stdout);   \
63        } while(0)
64
65#define LWIP_PLATFORM_ASSERT(x)                                  \
66        do {                                                     \
67            printf("Assertion \"%s\" failed at line %d in %s\n", \
68                   x, __LINE__, __FILE__);                       \
69            fflush(stdout);                                      \
70            abort();                                             \
71        } while(0)
72
73
74