]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * stdarg.h | |
3 | * Modified for use in 15-410 at CMU | |
4 | * Zachary Anderson(zra) | |
5 | */ | |
6 | ||
7 | /* | |
8 | * Copyright (c) 1994 The University of Utah and the Flux Group. | |
9 | * All rights reserved. | |
10 | * | |
11 | * This file is part of the Flux OSKit. The OSKit is free software, also known | |
12 | * as "open source;" you can redistribute it and/or modify it under the terms | |
13 | * of the GNU General Public License (GPL), version 2, as published by the Free | |
14 | * Software Foundation (FSF). To explore alternate licensing terms, contact | |
15 | * the University of Utah at csl-dist@cs.utah.edu or +1-801-585-3271. | |
16 | * | |
17 | * The OSKit is distributed in the hope that it will be useful, but WITHOUT ANY | |
18 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
19 | * FOR A PARTICULAR PURPOSE. See the GPL for more details. You should have | |
20 | * received a copy of the GPL along with the OSKit; see the file COPYING. If | |
21 | * not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA. | |
22 | */ | |
23 | ||
24 | /* | |
25 | * Mach Operating System | |
26 | * Copyright (c) 1993 Carnegie Mellon University. | |
27 | * All Rights Reserved. | |
28 | * | |
29 | * Permission to use, copy, modify and distribute this software and its | |
30 | * documentation is hereby granted, provided that both the copyright | |
31 | * notice and this permission notice appear in all copies of the | |
32 | * software, derivative works or modified versions, and any portions | |
33 | * thereof, and that both notices appear in supporting documentation. | |
34 | * | |
35 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
36 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
37 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
38 | * | |
39 | * Carnegie Mellon requests users of this software to return to | |
40 | * | |
41 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
42 | * School of Computer Science | |
43 | * Carnegie Mellon University | |
44 | * Pittsburgh PA 15213-3890 | |
45 | * | |
46 | * any improvements or extensions that they make and grant Carnegie Mellon | |
47 | * the rights to redistribute these changes. | |
48 | */ | |
49 | ||
50 | ||
51 | #ifndef _STDARG_H_ | |
52 | #define _STDARG_H_ | |
53 | ||
54 | #define __va_size(type) ((sizeof(type)+3) & ~0x3) | |
55 | ||
56 | #ifndef _VA_LIST_ | |
57 | #define _VA_LIST_ | |
58 | typedef char * va_list; | |
59 | #endif | |
60 | ||
61 | #define va_start(pvar, lastarg) \ | |
62 | ((pvar) = (char*)(void*)&(lastarg) + __va_size(lastarg)) | |
63 | #define va_end(pvar) | |
64 | #define va_arg(pvar,type) \ | |
65 | ((pvar) += __va_size(type), \ | |
66 | *((type *)((pvar) - __va_size(type)))) | |
67 | ||
68 | #endif /* _STDARG_H_ */ |