[BACK]Return to stdarg.h CVS log [TXT][DIR] Up to [local] / sys / sys

File: [local] / sys / sys / stdarg.h (download)

Revision 1.1, Tue Mar 4 16:16:13 2008 UTC (12 years, 5 months ago) by nbrk
Branch point for: MAIN

Initial revision

/*	$OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:06 millert Exp $ */
/*
 * Copyright (c) 2003, 2004  Marc espie <espie@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef _STDARG_H_
#define _STDARG_H_

#if defined(__GNUC__) && __GNUC__ >= 3

/* Define __gnuc_va_list.  */

#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
typedef __builtin_va_list __gnuc_va_list;
#endif

/* Note that the type used in va_arg is supposed to match the
   actual type **after default promotions**.
   Thus, va_arg (..., short) is not valid.  */

#define va_start(v,l)	__builtin_stdarg_start((v),l)
#define va_end		__builtin_va_end
#define va_arg		__builtin_va_arg
#define va_copy(d,s)	__builtin_va_copy((d),(s))
#define __va_copy(d,s)	__builtin_va_copy((d),(s))


typedef __gnuc_va_list va_list;

#else
#include <machine/stdarg.h>
#endif

#endif /* not _STDARG_H_ */