]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/ginclude/stdarg.h
[multiple changes]
[gcc.git] / gcc / ginclude / stdarg.h
index 5e7e757ee88ca1402665d3418ed275554fafd9fd..aa248be5da7bede58125a642dbeae50a46dce285 100644 (file)
@@ -1,8 +1,29 @@
-/* stdarg.h for GNU.
+/* Copyright (C) 1989-2017 Free Software Foundation, Inc.
 
-   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.  */
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C Standard:  7.15  Variable arguments  <stdarg.h>
+ */
 
 #ifndef _STDARG_H
 #ifndef _ANSI_STDARG_H_
@@ -23,11 +44,14 @@ typedef __builtin_va_list __gnuc_va_list;
    if this invocation was from the user program.  */
 #ifdef _STDARG_H
 
-#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_start(v,l)  __builtin_va_start(v,l)
+#define va_end(v)      __builtin_va_end(v)
+#define va_arg(v,l)    __builtin_va_arg(v,l)
+#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L \
+    || __cplusplus + 0 >= 201103L
+#define va_copy(d,s)   __builtin_va_copy(d,s)
+#endif
+#define __va_copy(d,s) __builtin_va_copy(d,s)
 
 /* Define va_list, if desired, from __gnuc_va_list. */
 /* We deliberately do not define va_list when called from
@@ -36,10 +60,6 @@ typedef __builtin_va_list __gnuc_va_list;
    but must not use that name.  It should use the name __gnuc_va_list,
    which is safe because it is reserved for the implementation.  */
 
-#ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
-#undef _VA_LIST
-#endif
-
 #ifdef _BSD_VA_LIST
 #undef _BSD_VA_LIST
 #endif
@@ -74,7 +94,10 @@ typedef __gnuc_va_list va_list;
 #ifndef _VA_LIST
 /* The macro _VA_LIST_T_H is used in the Bull dpx2  */
 #ifndef _VA_LIST_T_H
+/* The macro __va_list__ is used by BeOS.  */
+#ifndef __va_list__
 typedef __gnuc_va_list va_list;
+#endif /* not __va_list__ */
 #endif /* not _VA_LIST_T_H */
 #endif /* not _VA_LIST */
 #endif /* not _VA_LIST_DEFINED */
@@ -90,6 +113,9 @@ typedef __gnuc_va_list va_list;
 #ifndef _VA_LIST_T_H
 #define _VA_LIST_T_H
 #endif
+#ifndef __va_list__
+#define __va_list__
+#endif
 
 #endif /* not _VA_LIST_, except on certain systems */
 
This page took 0.02761 seconds and 5 git commands to generate.