eo301@0: /*===---- stdarg.h - Variable argument handling ----------------------------=== eo301@0: * eo301@0: * Copyright (c) 2008 Eli Friedman eo301@0: * eo301@0: * Permission is hereby granted, free of charge, to any person obtaining a copy eo301@0: * of this software and associated documentation files (the "Software"), to deal eo301@0: * in the Software without restriction, including without limitation the rights eo301@0: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell eo301@0: * copies of the Software, and to permit persons to whom the Software is eo301@0: * furnished to do so, subject to the following conditions: eo301@0: * eo301@0: * The above copyright notice and this permission notice shall be included in eo301@0: * all copies or substantial portions of the Software. eo301@0: * eo301@0: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR eo301@0: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, eo301@0: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE eo301@0: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER eo301@0: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, eo301@0: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN eo301@0: * THE SOFTWARE. eo301@0: * eo301@0: *===-----------------------------------------------------------------------=== eo301@0: */ eo301@0: eo301@0: #ifndef __STDARG_H eo301@0: #define __STDARG_H eo301@0: eo301@0: #ifndef _VA_LIST eo301@0: typedef __builtin_va_list va_list; eo301@0: #define _VA_LIST eo301@0: #endif eo301@0: #define va_start(ap, param) __builtin_va_start(ap, param) eo301@0: #define va_end(ap) __builtin_va_end(ap) eo301@0: #define va_arg(ap, type) __builtin_va_arg(ap, type) eo301@0: eo301@0: /* GCC always defines __va_copy, but does not define va_copy unless in c99 mode eo301@0: * or -ansi is not specified, since it was not part of C90. eo301@0: */ eo301@0: #define __va_copy(d,s) __builtin_va_copy(d,s) eo301@0: eo301@0: #if __STDC_VERSION__ >= 199900L || __cplusplus >= 201103L || !defined(__STRICT_ANSI__) eo301@0: #define va_copy(dest, src) __builtin_va_copy(dest, src) eo301@0: #endif eo301@0: eo301@0: /* Hack required to make standard headers work, at least on Ubuntu */ eo301@0: #define __GNUC_VA_LIST 1 eo301@0: typedef __builtin_va_list __gnuc_va_list; eo301@0: eo301@0: #endif /* __STDARG_H */