varargs.h revision 1543
11543Srgrimes/*-
21543Srgrimes * Copyright (c) 1990, 1993
31543Srgrimes *	The Regents of the University of California.  All rights reserved.
41543Srgrimes * (c) UNIX System Laboratories, Inc.
51543Srgrimes * All or some portions of this file are derived from material licensed
61543Srgrimes * to the University of California by American Telephone and Telegraph
71543Srgrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with
81543Srgrimes * the permission of UNIX System Laboratories, Inc.
91543Srgrimes *
101543Srgrimes * Redistribution and use in source and binary forms, with or without
111543Srgrimes * modification, are permitted provided that the following conditions
121543Srgrimes * are met:
131543Srgrimes * 1. Redistributions of source code must retain the above copyright
141543Srgrimes *    notice, this list of conditions and the following disclaimer.
151543Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
161543Srgrimes *    notice, this list of conditions and the following disclaimer in the
171543Srgrimes *    documentation and/or other materials provided with the distribution.
181543Srgrimes * 3. All advertising materials mentioning features or use of this software
191543Srgrimes *    must display the following acknowledgement:
201543Srgrimes *	This product includes software developed by the University of
211543Srgrimes *	California, Berkeley and its contributors.
221543Srgrimes * 4. Neither the name of the University nor the names of its contributors
231543Srgrimes *    may be used to endorse or promote products derived from this software
241543Srgrimes *    without specific prior written permission.
251543Srgrimes *
261543Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
271543Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
281543Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
291543Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
301543Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
311543Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
321543Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
331543Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
341543Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
351543Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
361543Srgrimes * SUCH DAMAGE.
371543Srgrimes *
381543Srgrimes *	@(#)varargs.h	8.2 (Berkeley) 3/22/94
391543Srgrimes */
401543Srgrimes
411543Srgrimes#ifndef _VARARGS_H_
421543Srgrimes#define	_VARARGS_H_
431543Srgrimes
441543Srgrimestypedef char *va_list;
451543Srgrimes
461543Srgrimes#define	va_dcl	int va_alist;
471543Srgrimes
481543Srgrimes#define	va_start(ap) \
491543Srgrimes	ap = (char *)&va_alist
501543Srgrimes
511543Srgrimes#ifdef KERNEL
521543Srgrimes#define	va_arg(ap, type) \
531543Srgrimes	((type *)(ap += sizeof(type)))[-1]
541543Srgrimes#else
551543Srgrimes#define	va_arg(ap, type) \
561543Srgrimes	((type *)(ap += sizeof(type) < sizeof(int) ? \
571543Srgrimes		(abort(), 0) : sizeof(type)))[-1]
581543Srgrimes#endif
591543Srgrimes
601543Srgrimes#define	va_end(ap)
611543Srgrimes
621543Srgrimes#endif /* !_VARARGS_H_ */
63