]>
Commit | Line | Data |
---|---|---|
1 | #ifndef _STDARG_H_ | |
2 | #define _STDARG_H_ | |
3 | ||
4 | /* stdarg.h | |
5 | * Copyright (c) 2008, Wes Filardo. | |
6 | * | |
7 | * This program is free software. It comes without any warranty, to | |
8 | * the extent permitted by applicable law. You can redistribute it | |
9 | * and/or modify it under the terms of the Do What The Fuck You Want | |
10 | * To Public License, Version 2, as reproduced below: | |
11 | * | |
12 | * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
13 | * Version 2, December 2004 | |
14 | * | |
15 | * Copyright (C) 2004 Sam Hocevar | |
16 | * 14 rue de Plaisance, 75014 Paris, France | |
17 | * Everyone is permitted to copy and distribute verbatim or modified | |
18 | * copies of this license document, and changing it is allowed as long | |
19 | * as the name is changed. | |
20 | * | |
21 | * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
22 | * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
23 | * | |
24 | * 0. You just DO WHAT THE FUCK YOU WANT TO. | |
25 | * | |
26 | */ | |
27 | ||
28 | /* This is awful, but really these are compiler intrinsics, so we use the | |
29 | * GNU compiler intrinsics. | |
30 | */ | |
31 | ||
32 | #ifdef __GNUC__ | |
33 | typedef __builtin_va_list va_list; | |
34 | #define va_start(v,l) __builtin_va_start(v,l) | |
35 | #define va_end(v) __builtin_va_end(v) | |
36 | #define va_arg(v,l) __builtin_va_arg(v,l) | |
37 | #define va_copy(d,s) __builtin_va_copy(d,s) | |
38 | #else | |
39 | #error "Don't know how to use varargs not on GNUC, sorry." | |
40 | #endif | |
41 | ||
42 | #endif |