-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathu.h
34 lines (31 loc) · 928 Bytes
/
u.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#define elem(x) ((int)(sizeof(x)/sizeof((x)[0])))
#define nil ((void*)0)
#define USED(x) if(x);
typedef unsigned short ushort;
typedef unsigned char uchar;
typedef unsigned long ulong;
typedef unsigned int uint;
typedef signed char schar;
typedef long long vlong;
typedef unsigned long long uvlong;
typedef long iptr;
typedef unsigned long uptr;
typedef unsigned long usize;
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef signed char i8;
typedef signed short i16;
typedef signed int i32;
typedef signed long long i64;
typedef char* va_list;
#define va_start(list, start) ((list) = (char*)((int*)&(start)+1))
#define va_end(list) \
USED(list)
#define va_arg(list, mode) \
((sizeof(mode) == 1) ? \
((list += 4), (mode*)list)[-4]: \
(sizeof(mode) == 2) ? \
((list += 4), (mode*)list)[-2]: \
((list += sizeof(mode)), (mode*)list)[-1])