[IP]
[reactos.git] / lib / drivers / lwip / src / include / arch / cc.h
1 /* ReactOS-Specific lwIP binding header - by Cameron Gutman */
2
3 #include <wdm.h>
4
5 #define LWIP_PROVIDE_ERRNO
6
7 /* ROS-specific mem defs */
8 void *
9 malloc(size_t size);
10
11 void *
12 calloc(size_t count, size_t size);
13
14 void
15 free(void *mem);
16
17 void *
18 realloc(void *mem, size_t size);
19
20 #define mem_realloc(_m_, _s_) realloc(_m_, _s_)
21
22 /* Unsigned int types */
23 typedef unsigned char u8_t;
24 typedef unsigned short u16_t;
25 typedef unsigned long u32_t;
26
27 /* Signed int types */
28 typedef signed char s8_t;
29 typedef signed short s16_t;
30 typedef signed long s32_t;
31
32 /* Memory pointer */
33 typedef u32_t mem_ptr_t;
34
35 /* Printf/DPRINT formatters */
36 #define U16_F "hu"
37 #define S16_F "hd"
38 #define X16_F "hx"
39 #define U32_F "lu"
40 #define S32_F "ld"
41 #define X32_F "lx"
42
43 /* Endianness */
44 #define BYTE_ORDER LITTLE_ENDIAN
45
46 /* Checksum calculation algorithm choice */
47 #define LWIP_CHKSUM_ALGORITHM 3
48
49 /* Diagnostics */
50 #define LWIP_PLATFORM_DIAG(x) DbgPrint(x)
51 #define LWIP_PLATFORM_ASSERT(x) ASSERTMSG(x, FALSE)
52
53 /* Synchronization */
54 #define SYS_ARCH_DECL_PROTECT(lev) \
55 sys_prot_t lev; \
56 sys_arch_decl_protect(&lev)
57 #define SYS_ARCH_PROTECT(lev) sys_arch_protect(&lev)
58 #define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(&lev)
59
60 /* Compiler hints for packing structures */
61 #define PACK_STRUCT_STRUCT
62 #define PACK_STRUCT_USE_INCLUDES
63