PS2SDK
PS2 Homebrew Libraries
cc.h
1 #ifndef __CC_H__
2 #define __CC_H__
3 
4 #include <errno.h>
5 #include <stdlib.h>
6 #include <stddef.h>
7 /* Upstream lwIP's sockets.h references struct timeval without including
8  sys/time.h when LWIP_TIMEVAL_PRIVATE=0. Pull it in via this port header
9  so every lwIP translation unit (and every consumer that #includes
10  arch/cc.h transitively through lwip/opt.h) sees struct timeval. */
11 #include <sys/time.h>
12 
13 #define PACK_STRUCT_FIELD(x) x __attribute((packed))
14 #define PACK_STRUCT_STRUCT __attribute((packed))
15 /* Used for struct fields of u8_t,
16  * where some compilers warn that packing is not necessary */
17 #define PACK_STRUCT_FLD_8(x) x
18 /* Used for struct fields of that are packed structs themself,
19  * where some compilers warn that packing is not necessary */
20 #define PACK_STRUCT_FLD_S(x) x
21 #define PACK_STRUCT_BEGIN
22 #define PACK_STRUCT_END
23 
24 #ifdef DEBUG
25 #include <stdio.h>
26 #define LWIP_PLATFORM_DIAG(args) printf args
27 #define LWIP_PLATFORM_ASSERT(args) printf args
28 #else
29 #define LWIP_PLATFORM_DIAG(args)
30 #define LWIP_PLATFORM_ASSERT(args)
31 #endif
32 
33 #define lwip_htons(x) PP_HTONS(x)
34 #define lwip_htonl(x) PP_HTONL(x)
35 
36 // I think there is an issue in the lwip code that doesn't import stdlib properly
37 #define LWIP_RAND() ((u32_t)rand())
38 
39 #endif /* __CC_H__ */
time.h
stdio.h
stdlib.h
errno.h