]> git.saurik.com Git - apple/xnu.git/blob - osfmk/libsa/i386/stdarg.h
xnu-344.23.tar.gz
[apple/xnu.git] / osfmk / libsa / i386 / stdarg.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_COPYRIGHT@
24 *
25 */
26 /*
27 * HISTORY
28 *
29 * Revision 1.2 1998/09/30 21:21:00 wsanchez
30 * Merged in IntelMerge1 (mburg: Intel support)
31 *
32 * Revision 1.1.2.1 1998/09/30 18:19:49 mburg
33 * Changes for Intel port
34 *
35 * Revision 1.1.1.1 1998/03/07 02:25:36 wsanchez
36 * Import of OSF Mach kernel (~mburg)
37 *
38 * Revision 1.1.2.1 1996/09/17 16:56:26 bruel
39 * created from standalone mach servers
40 * [1996/09/17 16:18:07 bruel]
41 *
42 * $EndLog$
43 */
44
45 #ifndef _MACHINE_STDARG_H
46 #define _MACHINE_STDARG_H
47
48 #include <machine/va_list.h>
49
50 /* Amount of space required in an argument list for an arg of type TYPE.
51 TYPE may alternatively be an expression whose type is used. */
52
53 #define __va_rounded_size(TYPE) \
54 (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
55
56 #define va_start(AP, LASTARG) \
57 (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
58
59 void va_end (va_list); /* Defined in gnulib */
60 #define va_end(AP)
61
62 #define va_arg(AP, mode) \
63 (AP += __va_rounded_size (mode), \
64 *((mode *) (AP - __va_rounded_size (mode))))
65
66 #endif /* _MACHINE_STDARG_H */