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