/*! \file include/stdio.h \brief some functions from the stdarg stuff \author Albert Huang (ashuang@cs.brown.edu) */ /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License * at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and * limitations under the License. * * The Original Code is legOS code, released October 17, 1999. * * The Initial Developer of the Original Code is Markus L. Noga. * Portions created by Markus L. Noga are Copyright (C) 1999 * Markus L. Noga. All Rights Reserved. * * Contributor(s): Albet Huang (ashuang@cs.brown.edu) */ #ifndef _STDARG_H #define _STDARG_H #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST typedef void *__gnuc_va_list; #endif #define __va_rounded_size(TYPE) \ (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) #define va_start(AP,LASTARG) \ (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG))) #define va_arg(AP, TYPE) \ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ *((TYPE *) (void *) ((char *) (AP) \ - ((sizeof (TYPE) < __va_rounded_size (int) \ ? sizeof (TYPE) : __va_rounded_size (TYPE)))))) #define va_end(AP) ((void) 0) #define __va_copy(dest, src) (dest) = (src) typedef __gnuc_va_list va_list; #endif /* not _STDARG_H */