PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
cc.h
1#ifndef __CC_H__
2#define __CC_H__
3
4#include <errno.h>
5#include <stddef.h>
6
7#define BYTE_ORDER LITTLE_ENDIAN
8
9typedef unsigned char u8_t;
10typedef signed char s8_t;
11typedef unsigned short int u16_t;
12typedef signed short s16_t;
13typedef unsigned int u32_t;
14typedef signed int s32_t;
15
16typedef u32_t mem_ptr_t;
17
18/* Define (sn)printf formatters for these lwIP types */
19#define U8_F "hu"
20#define S8_F "hd"
21#define X8_F "hx"
22#define U16_F "hu"
23#define S16_F "hd"
24#define X16_F "hx"
25#define U32_F "lu"
26#define S32_F "ld"
27#define X32_F "lx"
28#define SZT_F "uz"
29
30#define PACK_STRUCT_FIELD(x) x __attribute((packed))
31#define PACK_STRUCT_STRUCT __attribute((packed))
32/* Used for struct fields of u8_t,
33 * where some compilers warn that packing is not necessary */
34#define PACK_STRUCT_FLD_8(x) x
35/* Used for struct fields of that are packed structs themself,
36 * where some compilers warn that packing is not necessary */
37#define PACK_STRUCT_FLD_S(x) x
38#define PACK_STRUCT_BEGIN
39#define PACK_STRUCT_END
40
41#ifdef DEBUG
42#include <stdio.h>
43#define LWIP_PLATFORM_DIAG(args) printf args
44#define LWIP_PLATFORM_ASSERT(args) printf args
45#else
46#define LWIP_PLATFORM_DIAG(args)
47#define LWIP_PLATFORM_ASSERT(args)
48#endif
49
50#define atoi(x) strtol(x, NULL, 10)
51
52#define LWIP_NO_STDINT_H 1 //stdint.h does not exist.
53#define LWIP_NO_INTTYPES_H 1 //inttypes.h does not exist.
54
55#define lwip_htons(x) PP_HTONS(x)
56#define lwip_htonl(x) PP_HTONL(x)
57
58#endif /* __CC_H__ */