uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cc.h
Go to the documentation of this file.
1 #ifndef __CC_H__
2 #define __CC_H__
3 
4 #include <stdlib.h>
5 #include <stdint.h>
6 #include <string.h>
7 
8 #ifdef TARGET_BIG_ENDIAN
9 #define BYTE_ORDER BIG_ENDIAN
10 #else
11 #define BYTE_ORDER LITTLE_ENDIAN
12 #endif
13 
14 typedef uint8_t u8_t;
15 typedef int8_t s8_t;
16 typedef uint16_t u16_t;
17 typedef int16_t s16_t;
18 typedef uint32_t u32_t;
19 typedef int32_t s32_t;
20 
21 typedef uintptr_t mem_ptr_t;
22 
23 #define LWIP_ERR_T int
24 
25 /* Define (sn)printf formatters for these lwIP types */
26 #define U16_F "u"
27 #define S16_F "d"
28 #define X16_F "x"
29 #define U32_F "u"
30 #define S32_F "d"
31 #define X32_F "x"
32 
33 /* Compiler hints for packing structures */
34 #define PACK_STRUCT_FIELD(x) x
35 #define PACK_STRUCT_STRUCT __attribute__((packed))
36 #define PACK_STRUCT_BEGIN
37 #define PACK_STRUCT_END
38 
39 /* Plaform specific diagnostic output */
40 #define LWIP_PLATFORM_DIAG2(...) fprintf(stderr, __VA_ARGS__)
41 #define LWIP_PLATFORM_DIAG(x) LWIP_PLATFORM_DIAG2 x
42 #define LWIP_PLATFORM_ASSERT(x) do { \
43  fprintf(stderr, "Assert \"%s\" failed at line %d in %s\n", x, __LINE__, __FILE__); \
44  exit(-1); \
45 } while(0)
46 
47 #endif