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