stdarg.h (80709) | stdarg.h (96317) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2002 David E. O'Brien. All rights reserved. |
|
2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This software was developed by the Computer Systems Engineering group 6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 7 * contributed to Berkeley. 8 * 9 * All advertising materials mentioning features or use of this software --- 17 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * | 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This software was developed by the Computer Systems Engineering group 7 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * contributed to Berkeley. 9 * 10 * All advertising materials mentioning features or use of this software --- 17 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * |
35 * from: @(#)stdarg.h 8.2 (Berkeley) 9/27/93 36 * from: NetBSD: stdarg.h,v 1.11 2000/07/23 21:36:56 mycroft Exp 37 * $FreeBSD: head/sys/sparc64/include/stdarg.h 80709 2001-07-31 06:05:05Z jake $ | 36 * @(#)stdarg.h 8.2 (Berkeley) 9/27/93 37 * $NetBSD: stdarg.h,v 1.11 2000/07/23 21:36:56 mycroft Exp $ 38 * $FreeBSD: head/sys/sparc64/include/stdarg.h 96317 2002-05-10 02:02:54Z obrien $ |
38 */ 39 40#ifndef _MACHINE_STDARG_H_ 41#define _MACHINE_STDARG_H_ 42 43#include <machine/ansi.h> 44 45typedef _BSD_VA_LIST_ va_list; 46 | 39 */ 40 41#ifndef _MACHINE_STDARG_H_ 42#define _MACHINE_STDARG_H_ 43 44#include <machine/ansi.h> 45 46typedef _BSD_VA_LIST_ va_list; 47 |
48#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) 49 |
|
47#define va_start(ap, last) \ | 50#define va_start(ap, last) \ |
51 __builtin_stdarg_start((ap), (last)) 52 53#define va_arg(ap, type) \ 54 __builtin_va_arg((ap), type) 55 56#define va_end(ap) \ 57 __builtin_va_end(ap) 58 59#else /* ! __GNUC__ post GCC 2.95 */ 60 61#define va_start(ap, last) \ |
|
48 (__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs()) 49 50#define va_end(ap) 51 52#define __va_arg8(ap, type) \ 53 (*(type *)(void *)((ap) += 8, (ap) - 8)) 54#define __va_arg16(ap, type) \ 55 (*(type *)(void *)((ap) = (va_list)(((unsigned long)(ap) + 31) & -16),\ --- 8 unchanged lines hidden (view full) --- 64 (__alignof__(type) == 16 ? __va_arg16(ap, type) : \ 65 __va_arg8(ap, type)) : \ 66 (__builtin_classify_type(*(type *)0) < __RECORD_TYPE_CLASS ? \ 67 __va_int(ap, type) : \ 68 (sizeof(type) <= 8 ? __va_arg8(ap, type) : \ 69 (sizeof(type) <= 16 ? __va_arg16(ap, type) : \ 70 *__va_arg8(ap, type *))))) 71 | 62 (__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs()) 63 64#define va_end(ap) 65 66#define __va_arg8(ap, type) \ 67 (*(type *)(void *)((ap) += 8, (ap) - 8)) 68#define __va_arg16(ap, type) \ 69 (*(type *)(void *)((ap) = (va_list)(((unsigned long)(ap) + 31) & -16),\ --- 8 unchanged lines hidden (view full) --- 78 (__alignof__(type) == 16 ? __va_arg16(ap, type) : \ 79 __va_arg8(ap, type)) : \ 80 (__builtin_classify_type(*(type *)0) < __RECORD_TYPE_CLASS ? \ 81 __va_int(ap, type) : \ 82 (sizeof(type) <= 8 ? __va_arg8(ap, type) : \ 83 (sizeof(type) <= 16 ? __va_arg16(ap, type) : \ 84 *__va_arg8(ap, type *))))) 85 |
86#endif /* __GNUC__ post GCC 2.95 */ 87 |
|
72#endif /* !_MACHINE_STDARG_H_ */ | 88#endif /* !_MACHINE_STDARG_H_ */ |