diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1995-12-20 01:06:22 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1995-12-20 01:06:22 +0000 |
commit | c482518380683ee38d14024c1e362a0d681cf967 (patch) | |
tree | e69b4f6d3fee3aced20a41f3fdf543fc1c77fb5d /gnu/usr.bin/gcc/ginclude | |
parent | 76a62188d0db49c65b696d474c855a799fd96dce (diff) |
FSF GCC version 2.7.2
Diffstat (limited to 'gnu/usr.bin/gcc/ginclude')
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/iso646.h | 15 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/math-3300.h | 461 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/math-68881.h | 529 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/proto.h | 4 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/stdarg.h | 174 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/stddef.h | 311 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-alpha.h | 100 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-clipper.h | 57 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-h8300.h | 53 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-i860.h | 211 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-i960.h | 76 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-m88k.h | 84 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-mips.h | 110 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-pa.h | 49 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-ppc.h | 144 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-pyr.h | 130 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-sparc.h | 203 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/va-spur.h | 61 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/ginclude/varargs.h | 190 |
19 files changed, 2962 insertions, 0 deletions
diff --git a/gnu/usr.bin/gcc/ginclude/iso646.h b/gnu/usr.bin/gcc/ginclude/iso646.h new file mode 100644 index 00000000000..77ebdd30c4d --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/iso646.h @@ -0,0 +1,15 @@ +/* Macros for C programs written in national variants of ISO 646. */ + +#ifndef __cplusplus +#define and && +#define and_eq &= +#define bitand & +#define bitor | +#define compl ~ +#define not ! +#define not_eq != +#define or || +#define or_eq |= +#define xor ^ +#define xor_eq ^= +#endif diff --git a/gnu/usr.bin/gcc/ginclude/math-3300.h b/gnu/usr.bin/gcc/ginclude/math-3300.h new file mode 100644 index 00000000000..4e701257995 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/math-3300.h @@ -0,0 +1,461 @@ +/******************************************************************\ +* * +* <math-68881.h> last modified: 18 May 1989. * +* * +* Copyright (C) 1989 by Matthew Self. * +* You may freely distribute verbatim copies of this software * +* provided that this copyright notice is retained in all copies. * +* You may distribute modifications to this software under the * +* conditions above if you also clearly note such modifications * +* with their author and date. * +* * +* Note: errno is not set to EDOM when domain errors occur for * +* most of these functions. Rather, it is assumed that the * +* 68881's OPERR exception will be enabled and handled * +* appropriately by the operating system. Similarly, overflow * +* and underflow do not set errno to ERANGE. * +* * +* Send bugs to Matthew Self (self@bayes.arc.nasa.gov). * +* * +\******************************************************************/ + +#include <errno.h> + +#undef HUGE_VAL +#define HUGE_VAL \ +({ \ + double huge_val; \ + \ + __asm ("fmove%.d %#0x7ff0000000000000,%0" /* Infinity */ \ + : "=f" (huge_val) \ + : /* no inputs */); \ + huge_val; \ +}) + +__inline static const double sin (double x) +{ + double value; + + __asm ("fsin%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double cos (double x) +{ + double value; + + __asm ("fcos%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double tan (double x) +{ + double value; + + __asm ("ftan%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double asin (double x) +{ + double value; + + __asm ("fasin%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double acos (double x) +{ + double value; + + __asm ("facos%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double atan (double x) +{ + double value; + + __asm ("fatan%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double atan2 (double y, double x) +{ + double pi, pi_over_2; + + __asm ("fmovecr%.x %#0,%0" /* extended precision pi */ + : "=f" (pi) + : /* no inputs */ ); + __asm ("fscale%.b %#-1,%0" /* no loss of accuracy */ + : "=f" (pi_over_2) + : "0" (pi)); + if (x > 0) + { + if (y > 0) + { + if (x > y) + return atan (y / x); + else + return pi_over_2 - atan (x / y); + } + else + { + if (x > -y) + return atan (y / x); + else + return - pi_over_2 - atan (x / y); + } + } + else + { + if (y > 0) + { + if (-x > y) + return pi + atan (y / x); + else + return pi_over_2 - atan (x / y); + } + else + { + if (-x > -y) + return - pi + atan (y / x); + else if (y < 0) + return - pi_over_2 - atan (x / y); + else + { + double value; + + errno = EDOM; + __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */ + : "=f" (value) + : /* no inputs */); + return value; + } + } + } +} + +__inline static const double sinh (double x) +{ + double value; + + __asm ("fsinh%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double cosh (double x) +{ + double value; + + __asm ("fcosh%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double tanh (double x) +{ + double value; + + __asm ("ftanh%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double atanh (double x) +{ + double value; + + __asm ("fatanh%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double exp (double x) +{ + double value; + + __asm ("fetox%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double expm1 (double x) +{ + double value; + + __asm ("fetoxm1%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double log (double x) +{ + double value; + + __asm ("flogn%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double log1p (double x) +{ + double value; + + __asm ("flognp1%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double log10 (double x) +{ + double value; + + __asm ("flog10%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double sqrt (double x) +{ + double value; + + __asm ("fsqrt%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double pow (const double x, const double y) +{ + if (x > 0) + return exp (y * log (x)); + else if (x == 0) + { + if (y > 0) + return 0.0; + else + { + double value; + + errno = EDOM; + __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */ + : "=f" (value) + : /* no inputs */); + return value; + } + } + else + { + double temp; + + __asm ("fintrz%.x %1,%0" + : "=f" (temp) /* integer-valued float */ + : "f" (y)); + if (y == temp) + { + int i = (int) y; + + if (i & 1 == 0) /* even */ + return exp (y * log (x)); + else + return - exp (y * log (x)); + } + else + { + double value; + + errno = EDOM; + __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */ + : "=f" (value) + : /* no inputs */); + return value; + } + } +} + +__inline static const double fabs (double x) +{ + double value; + + __asm ("fabs%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline static const double ceil (double x) +{ + int rounding_mode, round_up; + double value; + + __asm volatile ("fmove%.l %%fpcr,%0" + : "=dm" (rounding_mode) + : /* no inputs */ ); + round_up = rounding_mode | 0x30; + __asm volatile ("fmove%.l %0,%%fpcr" + : /* no outputs */ + : "dmi" (round_up)); + __asm volatile ("fint%.x %1,%0" + : "=f" (value) + : "f" (x)); + __asm volatile ("fmove%.l %0,%%fpcr" + : /* no outputs */ + : "dmi" (rounding_mode)); + return value; +} + +__inline static const double floor (double x) +{ + int rounding_mode, round_down; + double value; + + __asm volatile ("fmove%.l %%fpcr,%0" + : "=dm" (rounding_mode) + : /* no inputs */ ); + round_down = (rounding_mode & ~0x10) + | 0x20; + __asm volatile ("fmove%.l %0,%%fpcr" + : /* no outputs */ + : "dmi" (round_down)); + __asm volatile ("fint%.x %1,%0" + : "=f" (value) + : "f" (x)); + __asm volatile ("fmove%.l %0,%%fpcr" + : /* no outputs */ + : "dmi" (rounding_mode)); + return value; +} + +__inline static const double rint (double x) +{ + int rounding_mode, round_nearest; + double value; + + __asm volatile ("fmove%.l %%fpcr,%0" + : "=dm" (rounding_mode) + : /* no inputs */ ); + round_nearest = rounding_mode & ~0x30; + __asm volatile ("fmove%.l %0,%%fpcr" + : /* no outputs */ + : "dmi" (round_nearest)); + __asm volatile ("fint%.x %1,%0" + : "=f" (value) + : "f" (x)); + __asm volatile ("fmove%.l %0,%%fpcr" + : /* no outputs */ + : "dmi" (rounding_mode)); + return value; +} + +__inline static const double fmod (double x, double y) +{ + double value; + + __asm ("fmod%.x %2,%0" + : "=f" (value) + : "0" (x), + "f" (y)); + return value; +} + +__inline static const double drem (double x, double y) +{ + double value; + + __asm ("frem%.x %2,%0" + : "=f" (value) + : "0" (x), + "f" (y)); + return value; +} + +__inline static const double scalb (double x, int n) +{ + double value; + + __asm ("fscale%.l %2,%0" + : "=f" (value) + : "0" (x), + "dmi" (n)); + return value; +} + +__inline static double logb (double x) +{ + double exponent; + + __asm ("fgetexp%.x %1,%0" + : "=f" (exponent) + : "f" (x)); + return exponent; +} + +__inline static const double ldexp (double x, int n) +{ + double value; + + __asm ("fscale%.l %2,%0" + : "=f" (value) + : "0" (x), + "dmi" (n)); + return value; +} + +__inline static double frexp (double x, int *exp) +{ + double float_exponent; + int int_exponent; + double mantissa; + + __asm ("fgetexp%.x %1,%0" + : "=f" (float_exponent) /* integer-valued float */ + : "f" (x)); + int_exponent = (int) float_exponent; + __asm ("fgetman%.x %1,%0" + : "=f" (mantissa) /* 1.0 <= mantissa < 2.0 */ + : "f" (x)); + if (mantissa != 0) + { + __asm ("fscale%.b %#-1,%0" + : "=f" (mantissa) /* mantissa /= 2.0 */ + : "0" (mantissa)); + int_exponent += 1; + } + *exp = int_exponent; + return mantissa; +} + +__inline static double modf (double x, double *ip) +{ + double temp; + + __asm ("fintrz%.x %1,%0" + : "=f" (temp) /* integer-valued float */ + : "f" (x)); + *ip = temp; + return x - temp; +} + diff --git a/gnu/usr.bin/gcc/ginclude/math-68881.h b/gnu/usr.bin/gcc/ginclude/math-68881.h new file mode 100644 index 00000000000..7b91bc56a5d --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/math-68881.h @@ -0,0 +1,529 @@ +/******************************************************************\ +* * +* <math-68881.h> last modified: 23 May 1992. * +* * +* Copyright (C) 1989 by Matthew Self. * +* You may freely distribute verbatim copies of this software * +* provided that this copyright notice is retained in all copies. * +* You may distribute modifications to this software under the * +* conditions above if you also clearly note such modifications * +* with their author and date. * +* * +* Note: errno is not set to EDOM when domain errors occur for * +* most of these functions. Rather, it is assumed that the * +* 68881's OPERR exception will be enabled and handled * +* appropriately by the operating system. Similarly, overflow * +* and underflow do not set errno to ERANGE. * +* * +* Send bugs to Matthew Self (self@bayes.arc.nasa.gov). * +* * +\******************************************************************/ + +/* This file is NOT a part of GCC, just distributed with it. */ + +/* If you find this in GCC, + please send bug reports to bug-gcc@prep.ai.mit.edu. */ + +/* Changed by Richard Stallman: + May 1993, add conditional to prevent multiple inclusion. + % inserted before a #. + New function `hypot' added. + Nans written in hex to avoid 0rnan. + May 1992, use %! for fpcr register. Break lines before function names. + December 1989, add parens around `&' in pow. + November 1990, added alternate definition of HUGE_VAL for Sun. */ + +/* Changed by Jim Wilson: + September 1993, Use #undef before HUGE_VAL instead of #ifdef/#endif. */ + +/* Changed by Ian Lance Taylor: + September 1994, use extern inline instead of static inline. */ + +#ifndef __math_68881 +#define __math_68881 + +#include <errno.h> + +#undef HUGE_VAL +#ifdef __sun__ +/* The Sun assembler fails to handle the hex constant in the usual defn. */ +#define HUGE_VAL \ +({ \ + static union { int i[2]; double d; } u = { {0x7ff00000, 0} }; \ + u.d; \ +}) +#else +#define HUGE_VAL \ +({ \ + double huge_val; \ + \ + __asm ("fmove%.d %#0x7ff0000000000000,%0" /* Infinity */ \ + : "=f" (huge_val) \ + : /* no inputs */); \ + huge_val; \ +}) +#endif + +__inline extern double +sin (double x) +{ + double value; + + __asm ("fsin%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +cos (double x) +{ + double value; + + __asm ("fcos%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +tan (double x) +{ + double value; + + __asm ("ftan%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +asin (double x) +{ + double value; + + __asm ("fasin%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +acos (double x) +{ + double value; + + __asm ("facos%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +atan (double x) +{ + double value; + + __asm ("fatan%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +atan2 (double y, double x) +{ + double pi, pi_over_2; + + __asm ("fmovecr%.x %#0,%0" /* extended precision pi */ + : "=f" (pi) + : /* no inputs */ ); + __asm ("fscale%.b %#-1,%0" /* no loss of accuracy */ + : "=f" (pi_over_2) + : "0" (pi)); + if (x > 0) + { + if (y > 0) + { + if (x > y) + return atan (y / x); + else + return pi_over_2 - atan (x / y); + } + else + { + if (x > -y) + return atan (y / x); + else + return - pi_over_2 - atan (x / y); + } + } + else + { + if (y < 0) + { + if (-x > -y) + return - pi + atan (y / x); + else + return - pi_over_2 - atan (x / y); + } + else + { + if (-x > y) + return pi + atan (y / x); + else if (y > 0) + return pi_over_2 - atan (x / y); + else + { + double value; + + errno = EDOM; + __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */ + : "=f" (value) + : /* no inputs */); + return value; + } + } + } +} + +__inline extern double +sinh (double x) +{ + double value; + + __asm ("fsinh%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +cosh (double x) +{ + double value; + + __asm ("fcosh%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +tanh (double x) +{ + double value; + + __asm ("ftanh%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +atanh (double x) +{ + double value; + + __asm ("fatanh%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +exp (double x) +{ + double value; + + __asm ("fetox%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +expm1 (double x) +{ + double value; + + __asm ("fetoxm1%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +log (double x) +{ + double value; + + __asm ("flogn%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +log1p (double x) +{ + double value; + + __asm ("flognp1%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +log10 (double x) +{ + double value; + + __asm ("flog10%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +sqrt (double x) +{ + double value; + + __asm ("fsqrt%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +hypot (double x, double y) +{ + return sqrt (x*x + y*y); +} + +__inline extern double +pow (double x, double y) +{ + if (x > 0) + return exp (y * log (x)); + else if (x == 0) + { + if (y > 0) + return 0.0; + else + { + double value; + + errno = EDOM; + __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */ + : "=f" (value) + : /* no inputs */); + return value; + } + } + else + { + double temp; + + __asm ("fintrz%.x %1,%0" + : "=f" (temp) /* integer-valued float */ + : "f" (y)); + if (y == temp) + { + int i = (int) y; + + if ((i & 1) == 0) /* even */ + return exp (y * log (-x)); + else + return - exp (y * log (-x)); + } + else + { + double value; + + errno = EDOM; + __asm ("fmove%.d %#0x7fffffffffffffff,%0" /* quiet NaN */ + : "=f" (value) + : /* no inputs */); + return value; + } + } +} + +__inline extern double +fabs (double x) +{ + double value; + + __asm ("fabs%.x %1,%0" + : "=f" (value) + : "f" (x)); + return value; +} + +__inline extern double +ceil (double x) +{ + int rounding_mode, round_up; + double value; + + __asm volatile ("fmove%.l %!,%0" + : "=dm" (rounding_mode) + : /* no inputs */ ); + round_up = rounding_mode | 0x30; + __asm volatile ("fmove%.l %0,%!" + : /* no outputs */ + : "dmi" (round_up)); + __asm volatile ("fint%.x %1,%0" + : "=f" (value) + : "f" (x)); + __asm volatile ("fmove%.l %0,%!" + : /* no outputs */ + : "dmi" (rounding_mode)); + return value; +} + +__inline extern double +floor (double x) +{ + int rounding_mode, round_down; + double value; + + __asm volatile ("fmove%.l %!,%0" + : "=dm" (rounding_mode) + : /* no inputs */ ); + round_down = (rounding_mode & ~0x10) + | 0x20; + __asm volatile ("fmove%.l %0,%!" + : /* no outputs */ + : "dmi" (round_down)); + __asm volatile ("fint%.x %1,%0" + : "=f" (value) + : "f" (x)); + __asm volatile ("fmove%.l %0,%!" + : /* no outputs */ + : "dmi" (rounding_mode)); + return value; +} + +__inline extern double +rint (double x) +{ + int rounding_mode, round_nearest; + double value; + + __asm volatile ("fmove%.l %!,%0" + : "=dm" (rounding_mode) + : /* no inputs */ ); + round_nearest = rounding_mode & ~0x30; + __asm volatile ("fmove%.l %0,%!" + : /* no outputs */ + : "dmi" (round_nearest)); + __asm volatile ("fint%.x %1,%0" + : "=f" (value) + : "f" (x)); + __asm volatile ("fmove%.l %0,%!" + : /* no outputs */ + : "dmi" (rounding_mode)); + return value; +} + +__inline extern double +fmod (double x, double y) +{ + double value; + + __asm ("fmod%.x %2,%0" + : "=f" (value) + : "0" (x), + "f" (y)); + return value; +} + +__inline extern double +drem (double x, double y) +{ + double value; + + __asm ("frem%.x %2,%0" + : "=f" (value) + : "0" (x), + "f" (y)); + return value; +} + +__inline extern double +scalb (double x, int n) +{ + double value; + + __asm ("fscale%.l %2,%0" + : "=f" (value) + : "0" (x), + "dmi" (n)); + return value; +} + +__inline extern double +logb (double x) +{ + double exponent; + + __asm ("fgetexp%.x %1,%0" + : "=f" (exponent) + : "f" (x)); + return exponent; +} + +__inline extern double +ldexp (double x, int n) +{ + double value; + + __asm ("fscale%.l %2,%0" + : "=f" (value) + : "0" (x), + "dmi" (n)); + return value; +} + +__inline extern double +frexp (double x, int *exp) +{ + double float_exponent; + int int_exponent; + double mantissa; + + __asm ("fgetexp%.x %1,%0" + : "=f" (float_exponent) /* integer-valued float */ + : "f" (x)); + int_exponent = (int) float_exponent; + __asm ("fgetman%.x %1,%0" + : "=f" (mantissa) /* 1.0 <= mantissa < 2.0 */ + : "f" (x)); + if (mantissa != 0) + { + __asm ("fscale%.b %#-1,%0" + : "=f" (mantissa) /* mantissa /= 2.0 */ + : "0" (mantissa)); + int_exponent += 1; + } + *exp = int_exponent; + return mantissa; +} + +__inline extern double +modf (double x, double *ip) +{ + double temp; + + __asm ("fintrz%.x %1,%0" + : "=f" (temp) /* integer-valued float */ + : "f" (x)); + *ip = temp; + return x - temp; +} + +#endif /* not __math_68881 */ diff --git a/gnu/usr.bin/gcc/ginclude/proto.h b/gnu/usr.bin/gcc/ginclude/proto.h new file mode 100644 index 00000000000..cc48915d842 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/proto.h @@ -0,0 +1,4 @@ +/* This header file is to avoid trouble with semi-ANSI header files + on the Convex in system version 8.0. */ + +#define _PROTO(list) () diff --git a/gnu/usr.bin/gcc/ginclude/stdarg.h b/gnu/usr.bin/gcc/ginclude/stdarg.h new file mode 100644 index 00000000000..ca79a3e2d63 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/stdarg.h @@ -0,0 +1,174 @@ +/* stdarg.h for GNU. + 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. */ + +#ifndef _STDARG_H +#ifndef _ANSI_STDARG_H_ +#ifndef __need___va_list +#define _STDARG_H +#define _ANSI_STDARG_H_ +#endif /* not __need___va_list */ +#undef __need___va_list + +#ifdef __clipper__ +#include <va-clipper.h> +#else +#ifdef __m88k__ +#include <va-m88k.h> +#else +#ifdef __i860__ +#include <va-i860.h> +#else +#ifdef __hppa__ +#include <va-pa.h> +#else +#ifdef __mips__ +#include <va-mips.h> +#else +#ifdef __sparc__ +#include <va-sparc.h> +#else +#ifdef __i960__ +#include <va-i960.h> +#else +#ifdef __alpha__ +#include <va-alpha.h> +#else +#if defined (__H8300__) || defined (__H8300H__) +#include <va-h8300.h> +#else +#if defined (__PPC__) && defined (_CALL_SYSV) +#include <va-ppc.h> +#else + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__) +typedef char *__gnuc_va_list; +#else +typedef void *__gnuc_va_list; +#endif +#endif + +/* Define the standard macros for the user, + if this invocation was from the user program. */ +#ifdef _STDARG_H + +/* Amount of space required in an argument list for an arg of type TYPE. + TYPE may alternatively be an expression whose type is used. */ + +#if defined(sysV68) +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short)) +#else +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) +#endif + +#define va_start(AP, LASTARG) \ + (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG))) + +#undef va_end +void va_end (__gnuc_va_list); /* Defined in libgcc.a */ +#define va_end(AP) ((void)0) + +/* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ + +#if defined (__arm__) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__) +/* This is for little-endian machines; small args are padded upward. */ +#define va_arg(AP, TYPE) \ + (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ + *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) +#else /* big-endian */ +/* This is for big-endian machines; small args are padded downward. */ +#define va_arg(AP, TYPE) \ + (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ + *((TYPE *) (void *) ((char *) (AP) \ + - ((sizeof (TYPE) < __va_rounded_size (char) \ + ? sizeof (TYPE) : __va_rounded_size (TYPE)))))) +#endif /* big-endian */ +#endif /* _STDARG_H */ + +#endif /* not powerpc with V.4 calling sequence */ +#endif /* not h8300 */ +#endif /* not alpha */ +#endif /* not i960 */ +#endif /* not sparc */ +#endif /* not mips */ +#endif /* not hppa */ +#endif /* not i860 */ +#endif /* not m88k */ +#endif /* not clipper */ + +#ifdef _STDARG_H +/* Define va_list, if desired, from __gnuc_va_list. */ +/* We deliberately do not define va_list when called from + stdio.h, because ANSI C says that stdio.h is not supposed to define + va_list. stdio.h needs to have access to that data type, + 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 + +#ifdef __svr4__ +/* SVR4.2 uses _VA_LIST for an internal alias for va_list, + so we must avoid testing it and setting it here. + SVR4 uses _VA_LIST as a flag in stdarg.h, but we should + have no conflict with that. */ +#ifndef _VA_LIST_ +#define _VA_LIST_ +#ifdef __i860__ +#ifndef _VA_LIST +#define _VA_LIST va_list +#endif +#endif /* __i860__ */ +typedef __gnuc_va_list va_list; +#endif /* _VA_LIST_ */ +#else /* not __svr4__ */ + +/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. + But on BSD NET2 we must not test or define or undef it. + (Note that the comments in NET 2's ansi.h + are incorrect for _VA_LIST_--see stdio.h!) */ +#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) +/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ +#ifndef _VA_LIST_DEFINED +/* The macro _VA_LIST is used in SCO Unix 3.2. */ +#ifndef _VA_LIST +/* The macro _VA_LIST_T_H is used in the Bull dpx2 */ +#ifndef _VA_LIST_T_H +typedef __gnuc_va_list va_list; +#endif /* not _VA_LIST_T_H */ +#endif /* not _VA_LIST */ +#endif /* not _VA_LIST_DEFINED */ +#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) +#define _VA_LIST_ +#endif +#ifndef _VA_LIST +#define _VA_LIST +#endif +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED +#endif +#ifndef _VA_LIST_T_H +#define _VA_LIST_T_H +#endif + +#endif /* not _VA_LIST_, except on certain systems */ + +#endif /* not __svr4__ */ + +#endif /* _STDARG_H */ + +#endif /* not _ANSI_STDARG_H_ */ +#endif /* not _STDARG_H */ diff --git a/gnu/usr.bin/gcc/ginclude/stddef.h b/gnu/usr.bin/gcc/ginclude/stddef.h new file mode 100644 index 00000000000..af3071fbfe7 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/stddef.h @@ -0,0 +1,311 @@ +#ifndef _STDDEF_H +#ifndef _STDDEF_H_ +#ifndef _ANSI_STDDEF_H +#ifndef __STDDEF_H__ + +/* Any one of these symbols __need_* means that GNU libc + wants us just to define one data type. So don't define + the symbols that indicate this file's entire job has been done. */ +#if (!defined(__need_wchar_t) && !defined(__need_size_t) \ + && !defined(__need_ptrdiff_t) && !defined(__need_NULL)) +#define _STDDEF_H +#define _STDDEF_H_ +/* snaroff@next.com says the NeXT needs this. */ +#define _ANSI_STDDEF_H +/* Irix 5.1 needs this. */ +#define __STDDEF_H__ +#endif + +#ifndef __sys_stdtypes_h +/* This avoids lossage on SunOS but only if stdtypes.h comes first. + There's no way to win with the other order! Sun lossage. */ + +/* On 4.3bsd-net2, make sure ansi.h is included, so we have + one less case to deal with in the following. */ +#if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) || defined(__NetBSD__) +#include <machine/ansi.h> +#endif + +/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are + defined if the corresponding type is *not* defined. + FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */ +#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) +#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_) +#define _SIZE_T +#endif +#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_) +#define _PTRDIFF_T +#endif +/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ + instead of _WCHAR_T_. */ +#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_) +#ifndef _BSD_WCHAR_T_ +#define _WCHAR_T +#endif +#endif +/* Undef _FOO_T_ if we are supposed to define foo_t. */ +#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_) +#undef _PTRDIFF_T_ +#undef _BSD_PTRDIFF_T_ +#endif +#if defined (__need_size_t) || defined (_STDDEF_H_) +#undef _SIZE_T_ +#undef _BSD_SIZE_T_ +#endif +#if defined (__need_wchar_t) || defined (_STDDEF_H_) +#undef _WCHAR_T_ +#undef _BSD_WCHAR_T_ +#endif +#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */ + +/* Sequent's header files use _PTRDIFF_T_ in some conflicting way. + Just ignore it. */ +#if defined (__sequent__) && defined (_PTRDIFF_T_) +#undef _PTRDIFF_T_ +#endif + +/* On VxWorks, <type/vxTypesBase.h> may have defined macros like + _TYPE_size_t which will typedef size_t. fixincludes patched the + vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is + not defined, and so that defining this macro defines _GCC_SIZE_T. + If we find that the macros are still defined at this point, we must + invoke them so that the type is defined as expected. */ +#if defined (TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_)) +_TYPE_ptrdiff_t; +#undef _TYPE_ptrdiff_t +#endif +#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_)) +_TYPE_size_t; +#undef _TYPE_size_t +#endif +#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_)) +_TYPE_wchar_t; +#undef _TYPE_wchar_t +#endif + +/* In case nobody has defined these types, but we aren't running under + GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE__TYPE__, and + __WCHAR_TYPE__ have reasonable values. This can happen if the + parts of GCC is compiled by an older compiler, that actually + include gstddef.h, such as collect2. */ + +/* Signed type of difference of two pointers. */ + +/* Define this type if we are doing the whole job, + or if we want this type in particular. */ +#if defined (_STDDEF_H) || defined (__need_ptrdiff_t) +#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */ +#ifndef _T_PTRDIFF_ +#ifndef _T_PTRDIFF +#ifndef __PTRDIFF_T +#ifndef _PTRDIFF_T_ +#ifndef _BSD_PTRDIFF_T_ +#ifndef ___int_ptrdiff_t_h +#ifndef _GCC_PTRDIFF_T +#define _PTRDIFF_T +#define _T_PTRDIFF_ +#define _T_PTRDIFF +#define __PTRDIFF_T +#define _PTRDIFF_T_ +#define _BSD_PTRDIFF_T_ +#define ___int_ptrdiff_t_h +#define _GCC_PTRDIFF_T +#ifndef __PTRDIFF_TYPE__ +#define __PTRDIFF_TYPE__ long int +#endif +typedef __PTRDIFF_TYPE__ ptrdiff_t; +#endif /* _GCC_PTRDIFF_T */ +#endif /* ___int_ptrdiff_t_h */ +#endif /* _BSD_PTRDIFF_T_ */ +#endif /* _PTRDIFF_T_ */ +#endif /* __PTRDIFF_T */ +#endif /* _T_PTRDIFF */ +#endif /* _T_PTRDIFF_ */ +#endif /* _PTRDIFF_T */ + +/* If this symbol has done its job, get rid of it. */ +#undef __need_ptrdiff_t + +#endif /* _STDDEF_H or __need_ptrdiff_t. */ + +/* Unsigned type of `sizeof' something. */ + +/* Define this type if we are doing the whole job, + or if we want this type in particular. */ +#if defined (_STDDEF_H) || defined (__need_size_t) +#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */ +#ifndef _SYS_SIZE_T_H +#ifndef _T_SIZE_ +#ifndef _T_SIZE +#ifndef __SIZE_T +#ifndef _SIZE_T_ +#ifndef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#ifndef _SIZE_T_DEFINED +#ifndef ___int_size_t_h +#ifndef _GCC_SIZE_T +#ifndef _SIZET_ +#ifndef __size_t +#define _SIZE_T +#define _SYS_SIZE_T_H +#define _T_SIZE_ +#define _T_SIZE +#define __SIZE_T +#define _SIZE_T_ +#define _BSD_SIZE_T_ +#define _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED +#define ___int_size_t_h +#define _GCC_SIZE_T +#define _SIZET_ +#define __size_t +#ifndef __SIZE_TYPE__ +#define __SIZE_TYPE__ long unsigned int +#endif +#if !(defined (__GNUG__) && defined (size_t)) +typedef __SIZE_TYPE__ size_t; +#endif /* !(defined (__GNUG__) && defined (size_t)) */ +#endif /* __size_t */ +#endif /* _SIZET_ */ +#endif /* _GCC_SIZE_T */ +#endif /* ___int_size_t_h */ +#endif /* _SIZE_T_DEFINED */ +#endif /* _SIZE_T_DEFINED_ */ +#endif /* _BSD_SIZE_T_ */ +#endif /* _SIZE_T_ */ +#endif /* __SIZE_T */ +#endif /* _T_SIZE */ +#endif /* _T_SIZE_ */ +#endif /* _SYS_SIZE_T_H */ +#endif /* _SIZE_T */ +#undef __need_size_t +#endif /* _STDDEF_H or __need_size_t. */ + + +/* Wide character type. + Locale-writers should change this as necessary to + be big enough to hold unique values not between 0 and 127, + and not (wchar_t) -1, for each defined multibyte character. */ + +/* Define this type if we are doing the whole job, + or if we want this type in particular. */ +#if defined (_STDDEF_H) || defined (__need_wchar_t) +#ifndef _WCHAR_T +#ifndef _T_WCHAR_ +#ifndef _T_WCHAR +#ifndef __WCHAR_T +#ifndef _WCHAR_T_ +#ifndef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DEFINED_ +#ifndef _WCHAR_T_DEFINED +#ifndef _WCHAR_T_H +#ifndef ___int_wchar_t_h +#ifndef __INT_WCHAR_T_H +#ifndef _GCC_WCHAR_T +#define _WCHAR_T +#define _T_WCHAR_ +#define _T_WCHAR +#define __WCHAR_T +#define _WCHAR_T_ +#define _BSD_WCHAR_T_ +#define _WCHAR_T_DEFINED_ +#define _WCHAR_T_DEFINED +#define _WCHAR_T_H +#define ___int_wchar_t_h +#define __INT_WCHAR_T_H +#define _GCC_WCHAR_T + +/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_ + instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other + symbols in the _FOO_T_ family, stays defined even after its + corresponding type is defined). If we define wchar_t, then we + must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if + we undef _WCHAR_T_, then we must also define rune_t, since + headers like runetype.h assume that if machine/ansi.h is included, + and _BSD_WCHAR_T_ is not defined, then rune_t is available. + machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of + the same type." */ +#ifdef _BSD_WCHAR_T_ +#undef _BSD_WCHAR_T_ +#ifdef _BSD_RUNE_T_ +#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) +typedef _BSD_RUNE_T_ rune_t; +#endif +#endif +#endif + +#ifndef __WCHAR_TYPE__ +#define __WCHAR_TYPE__ int +#endif +#ifndef __cplusplus +typedef __WCHAR_TYPE__ wchar_t; +#endif +#endif +#endif +#endif +#endif +#endif +#endif +#endif +#endif +#endif +#endif +#endif +#endif +#undef __need_wchar_t +#endif /* _STDDEF_H or __need_wchar_t. */ + +/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. + are already defined. */ +#ifdef _ANSI_H_ +/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ + are probably typos and should be removed before 2.8 is released. */ +#ifdef _GCC_PTRDIFF_T_ +#undef _PTRDIFF_T_ +#undef _BSD_PTRDIFF_T_ +#endif +#ifdef _GCC_SIZE_T_ +#undef _SIZE_T_ +#undef _BSD_SIZE_T_ +#endif +#ifdef _GCC_WCHAR_T_ +#undef _WCHAR_T_ +#undef _BSD_WCHAR_T_ +#endif +/* The following ones are the real ones. */ +#ifdef _GCC_PTRDIFF_T +#undef _PTRDIFF_T_ +#undef _BSD_PTRDIFF_T_ +#endif +#ifdef _GCC_SIZE_T +#undef _SIZE_T_ +#undef _BSD_SIZE_T_ +#endif +#ifdef _GCC_WCHAR_T +#undef _WCHAR_T_ +#undef _BSD_WCHAR_T_ +#endif +#endif /* _ANSI_H_ */ + +#endif /* __sys_stdtypes_h */ + +/* A null pointer constant. */ + +#if defined (_STDDEF_H) || defined (__need_NULL) +#undef NULL /* in case <stdio.h> has defined it. */ +#define NULL ((void *)0) +#endif /* NULL not defined and <stddef.h> or need NULL. */ +#undef __need_NULL + +#ifdef _STDDEF_H + +/* Offset of member MEMBER in a struct of type TYPE. */ + +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) + +#endif /* _STDDEF_H was defined this time */ + +#endif /* __STDDEF_H__ was not defined before */ +#endif /* _ANSI_STDDEF_H was not defined before */ +#endif /* _STDDEF_H_ was not defined before */ +#endif /* _STDDEF_H was not defined before */ diff --git a/gnu/usr.bin/gcc/ginclude/va-alpha.h b/gnu/usr.bin/gcc/ginclude/va-alpha.h new file mode 100644 index 00000000000..33f6c2dec74 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-alpha.h @@ -0,0 +1,100 @@ +/* GNU C varargs and stdargs support for the DEC Alpha. */ + +/* Note: We must use the name __builtin_savregs. GCC attaches special + significance to that name. In particular, regardless of where in a + function __builtin_saveregs is called, GCC moves the call up to the + very start of the function. */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + +typedef struct { + char *__base; /* Pointer to first integer register. */ + int __offset; /* Byte offset of args so far. */ +} __gnuc_va_list; +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +#define va_list __gnuc_va_list +#define _VA_LIST +#define _VA_LIST_ + +#if !defined(_STDARG_H) + +/* varargs support */ +#define va_alist __builtin_va_alist +#define va_dcl int __builtin_va_alist;... +#define va_start(pvar) ((pvar) = * (__gnuc_va_list *) __builtin_saveregs ()) + +#else /* STDARG.H */ + +/* ANSI alternative. */ + +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that firstarg is correct. */ +#define va_start(pvar, firstarg) \ + (__builtin_next_arg (firstarg), \ + (pvar) = *(__gnuc_va_list *) __builtin_saveregs ()) + +#endif /* _STDARG_H */ + +#ifndef va_end + +#define va_end(__va) ((void) 0) + +/* Values returned by __builtin_classify_type. */ + +enum { + __no_type_class = -1, + __void_type_class, + __integer_type_class, + __char_type_class, + __enumeral_type_class, + __boolean_type_class, + __pointer_type_class, + __reference_type_class, + __offset_type_class, + __real_type_class, + __complex_type_class, + __function_type_class, + __method_type_class, + __record_type_class, + __union_type_class, + __array_type_class, + __string_type_class, + __set_type_class, + __file_type_class, + __lang_type_class +}; + +#endif + +/* Note that parameters are always aligned at least to a word boundary + (when passed) regardless of what GCC's __alignof__ operator says. */ + +/* Avoid errors if compiling GCC v2 with GCC v1. */ +#if __GNUC__ == 1 +#define __extension__ +#endif + +/* Get the size of a type in bytes, rounded up to an integral number + of words. */ + +#define __va_tsize(__type) \ + (((sizeof (__type) + __extension__ sizeof (long long) - 1) \ + / __extension__ sizeof (long long)) * __extension__ sizeof (long long)) + +#define va_arg(__va, __type) \ +(*(((__va).__offset += __va_tsize (__type)), \ + (__type *)(void *)((__va).__base + (__va).__offset \ + - (((__builtin_classify_type (* (__type *) 0) \ + == __real_type_class) && (__va).__offset <= (6 * 8)) \ + ? (6 * 8) + 8 : __va_tsize (__type))))) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ + diff --git a/gnu/usr.bin/gcc/ginclude/va-clipper.h b/gnu/usr.bin/gcc/ginclude/va-clipper.h new file mode 100644 index 00000000000..21ddc562885 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-clipper.h @@ -0,0 +1,57 @@ +/* GNU C varargs and stdargs support for Clipper. */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + +typedef struct +{ + int __va_ap; /* pointer to stack args */ + void *__va_reg[4]; /* pointer to r0,f0,r1,f1 */ + int __va_num; /* number of args processed */ +} __gnuc_va_list; +#endif /* not __GNUC_VA_LIST */ + + +#if defined (_STDARG_H) || defined (_VARARGS_H) +#define va_list __gnuc_va_list +#define __va_list __gnuc_va_list /* acc compatibility */ + +#define _VA_LIST +#define _VA_LIST_ +#define _SYS_INT_STDARG_H /* acc compatibility */ + +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that LASTARG is correct. */ +#ifdef _STDARG_H +#define va_start(AP,LASTARG) \ + (__builtin_next_arg (LASTARG), \ + (AP) = *(va_list *)__builtin_saveregs(), \ + (AP).__va_num = __builtin_args_info (0), \ + (AP).__va_ap += __builtin_args_info (1)) +#else +#define va_alist __builtin_va_alist +/* The ... causes current_function_varargs to be set in cc1. */ +#define va_dcl va_list __builtin_va_alist; ... +#define va_start(AP) \ + ((AP) = *(va_list *)__builtin_saveregs(), \ + (AP).__va_num = __builtin_args_info (0)) +#endif /* _STDARG_H */ + +/* round to alignment of `type' but keep a least integer alignment */ +#define __va_round(AP,TYPE) \ + ((AP).__va_ap = ((AP).__va_ap + __alignof__ (TYPE) - 1 ) & \ + ~(__alignof__ (TYPE) - 1), \ + ((AP).__va_ap = ((AP).__va_ap + sizeof (int) - 1) & ~(sizeof (int) - 1))) + +#define va_arg(AP, TYPE) \ + (*((AP).__va_num < 2 && __builtin_classify_type (* (TYPE *)0) < 12 \ + ? (__builtin_classify_type (* (TYPE *)0) == 8 \ + ? ((TYPE *)(AP).__va_reg[2 * (AP).__va_num++ + 1]) \ + : ((TYPE *)(AP).__va_reg[2 * (AP).__va_num++ ])) \ + : ((AP).__va_num++, __va_round (AP,TYPE), ((TYPE *)((AP).__va_ap))++))) + +#define va_end(AP) ((void) 0) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/gnu/usr.bin/gcc/ginclude/va-h8300.h b/gnu/usr.bin/gcc/ginclude/va-h8300.h new file mode 100644 index 00000000000..986e827f64d --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-h8300.h @@ -0,0 +1,53 @@ +/* stdarg/vararg support for the Hitachi h8/300 and h8/300h */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +typedef void *__gnuc_va_list; +#endif + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +/* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + +#if __GNUC__ > 1 +#define __va_ellipsis ... +#else +#define __va_ellipsis +#endif + +#ifdef __H8300__ +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) +#else +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (long) - 1) / sizeof (long)) * sizeof (long)) +#endif + +#ifdef _STDARG_H + +#define va_start(AP,LASTARG) \ + (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG))) + +#else /* _VARARGS_H */ + +#define va_alist __builtin_va_alist +/* The ... causes current_function_varargs to be set in cc1. */ +#define va_dcl int __builtin_va_alist; __va_ellipsis +#define va_start(AP) AP = (void *) &__builtin_va_alist + +#endif /* _VARARGS_H */ + +#define va_arg(AP, TYPE) \ + (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ + *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \ + ? sizeof (TYPE) \ + : __va_rounded_size (TYPE)))))) + +#define va_end(AP) ((void) 0) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/gnu/usr.bin/gcc/ginclude/va-i860.h b/gnu/usr.bin/gcc/ginclude/va-i860.h new file mode 100644 index 00000000000..9b9908a0aa5 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-i860.h @@ -0,0 +1,211 @@ +/* Note: We must use the name __builtin_savregs. GCC attaches special + significance to that name. In particular, regardless of where in a + function __builtin_saveregs is called, GCC moves the call up to the + very start of the function. */ + + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + +typedef union { + float __freg[8]; + double __dreg[4]; +} __f_regs; + +typedef struct { +#if defined (__SVR4__) || defined (__svr4__) || defined (__alliant__) || defined (__PARAGON__) + __f_regs __float_regs; long __ireg[12]; +#else /* pre-SVR4 */ + long __ireg[12]; __f_regs __float_regs; +#endif +} __va_saved_regs; + +typedef struct { +#if defined(__SVR4__) || defined(__svr4__) || defined(__alliant__) || defined (__PARAGON__) + unsigned __ireg_used; /* How many int regs consumed 'til now? */ + unsigned __freg_used; /* How many flt regs consumed 'til now? */ + long *__reg_base; /* Address of where we stored the regs. */ + long * __mem_ptr; /* Address of memory overflow args area. */ +#else /* pre-SVR4 */ + long *__reg_base; /* Address of where we stored the regs. */ + long * __mem_ptr; /* Address of memory overflow args area. */ + unsigned __ireg_used; /* How many int regs consumed 'til now? */ + unsigned __freg_used; /* How many flt regs consumed 'til now? */ +#endif +} __gnuc_va_list; +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +#if !defined(_STDARG_H) + +/* varargs support */ +#define va_alist __builtin_va_alist +#if defined (__PARAGON__) +#define va_dcl int va_alist; +#else /* __PARAGON__ */ +#define va_dcl +#endif /* __PARAGON__ */ +#define va_start(pvar) ((pvar) = * (__gnuc_va_list *) __builtin_saveregs ()) + +#else /* STDARG.H */ + +/* ANSI alternative. */ +/* Note that CUMULATIVE_ARGS elements are measured in bytes on the i860, + so we divide by 4 to get # of registers. */ +#define va_start(pvar, firstarg) \ + ((pvar) = *(__gnuc_va_list *) __builtin_saveregs (), \ + (pvar).__ireg_used = __builtin_args_info (0) / 4, \ + (pvar).__freg_used = __builtin_args_info (1) / 4, \ + (pvar).__mem_ptr = __builtin_next_arg (firstarg)) + +#endif /* _STDARG_H */ + +/* Values returned by __builtin_classify_type. */ + +#ifndef va_end +enum { + __no_type_class = -1, + __void_type_class, + __integer_type_class, + __char_type_class, + __enumeral_type_class, + __boolean_type_class, + __pointer_type_class, + __reference_type_class, + __offset_type_class, + __real_type_class, + __complex_type_class, + __function_type_class, + __method_type_class, + __record_type_class, + __union_type_class, + __array_type_class, + __string_type_class, + __set_type_class, + __file_type_class, + __lang_type_class +}; + +void va_end (__gnuc_va_list); /* Defined in libgcc.a */ +#endif +#define va_end(__va) ((void) 0) + +#define __NUM_PARM_FREGS 8 +#define __NUM_PARM_IREGS 12 + +#define __savereg(__va) ((__va_saved_regs *) ((__va).__reg_base)) + +/* This macro works both for SVR4 and pre-SVR4 environments. */ + +/* Note that parameters are always aligned at least to a word boundary + (when passed) regardless of what GCC's __alignof__ operator says. */ + +/* Make allowances here for adding 128-bit (long double) floats someday. */ + +#if 0 /* What was this for? */ +#ifndef __GNU_VA_LIST +#define __ireg_used ireg_used +#define __freg_used freg_used +#define __mem_ptr mem_ptr +#define __reg_base reg_base +#endif +#endif /* 0 */ + +/* Avoid errors if compiling GCC v2 with GCC v1. */ +#if __GNUC__ == 1 +#define __extension__ +#endif + +#define va_arg(__va, __type) \ +__extension__ \ +(* (__type *) \ +({ \ + register void *__rv; /* result value */ \ + register unsigned __align; \ + switch (__builtin_classify_type (* (__type *) 0)) \ + { \ + case __real_type_class: \ + switch (sizeof (__type)) \ + { \ + case sizeof (float): \ + case sizeof (double): \ + if ((__va).__freg_used < __NUM_PARM_FREGS - 1) \ + { \ + if (((__va).__freg_used & 1) != 0) \ + (__va).__freg_used++; /* skip odd */ \ + __rv = &__savereg((__va))->__float_regs.__freg[(__va).__freg_used];\ + (__va).__freg_used += 2; \ + } \ + else \ + { \ + if ((((unsigned) (__va).__mem_ptr) & (sizeof(double)-1)) != 0) \ + (__va).__mem_ptr++; /* skip odd */ \ + __rv = (__va).__mem_ptr; \ + (__va).__mem_ptr += 2; \ + } \ + if (sizeof (__type) == sizeof (float)) \ + { \ + *((float *) __rv) = *((double *) __rv); \ + *(((long *) __rv) + 1) = 0xfff00001; \ + } \ + break; \ + default: \ + abort (); \ + } \ + break; \ + case __void_type_class: \ + case __integer_type_class: \ + case __char_type_class: \ + case __enumeral_type_class: \ + case __boolean_type_class: \ + case __pointer_type_class: \ + case __reference_type_class: \ + case __offset_type_class: \ + if (sizeof (__type) <= 4) \ + { \ + __rv = ((__va).__ireg_used < __NUM_PARM_IREGS \ + ? (&__savereg((__va))->__ireg[(__va).__ireg_used++]) \ + : (__va).__mem_ptr++); \ + break; \ + } \ + else if ((__va).__ireg_used + sizeof (__type) / 4 <= __NUM_PARM_IREGS) \ + { \ + __rv = &__savereg((__va))->__ireg[(__va).__ireg_used]; \ + (__va).__ireg_used += sizeof (__type) / 4; \ + break; \ + } \ + /* Fall through to fetch from memory. */ \ + case __record_type_class: \ + case __union_type_class: \ + __align = (__alignof__ (__type) < sizeof (long) \ + ? sizeof (long) \ + : __alignof__ (__type)); \ + (__va).__mem_ptr \ + = (long *) \ + ((((unsigned) (__va).__mem_ptr) + (__align-1)) & ~(__align-1)); \ + __rv = (__va).__mem_ptr; \ + (__va).__mem_ptr \ + += ((sizeof (__type) + sizeof (long) - 1) / sizeof (long)); \ + break; \ + case __complex_type_class: \ + case __function_type_class: \ + case __method_type_class: \ + case __array_type_class: \ + case __string_type_class: \ + case __set_type_class: \ + case __file_type_class: \ + case __lang_type_class: \ + case __no_type_class: \ + default: \ + abort (); \ + } \ + __rv; \ +})) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ + diff --git a/gnu/usr.bin/gcc/ginclude/va-i960.h b/gnu/usr.bin/gcc/ginclude/va-i960.h new file mode 100644 index 00000000000..a30d5f542a4 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-i960.h @@ -0,0 +1,76 @@ +/* GNU C varargs support for the Intel 80960. */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +/* The first element is the address of the first argument. + The second element is the number of bytes skipped past so far. */ +typedef unsigned __gnuc_va_list[2]; +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +/* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + +#if __GNUC__ > 1 +#define __va_ellipsis ... +#else +#define __va_ellipsis +#endif + +/* The stack size of the type t. */ +#define __vsiz(T) (((sizeof (T) + 3) / 4) * 4) +/* The stack alignment of the type t. */ +#define __vali(T) (__alignof__ (T) >= 4 ? __alignof__ (T) : 4) +/* The offset of the next stack argument after one of type t at offset i. */ +#define __vpad(I, T) ((((I) + __vali (T) - 1) / __vali (T)) \ + * __vali (T) + __vsiz (T)) + +/* Avoid errors if compiling GCC v2 with GCC v1. */ +#if __GNUC__ == 1 +#define __extension__ +#endif + +#ifdef _STDARG_H +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that firstarg is correct. */ +#define va_start(AP, LASTARG) \ +__extension__ \ +({ __builtin_next_arg (LASTARG); \ + __asm__ ("st g14,%0" : "=m" (*(AP))); \ + (AP)[1] = (__builtin_args_info (0) + __builtin_args_info (1)) * 4; }) + +#else + +#define va_alist __builtin_va_alist +#define va_dcl char *__builtin_va_alist; __va_ellipsis +#define va_start(AP) \ +__extension__ \ +({ __asm__ ("st g14,%0" : "=m" (*(AP))); \ + (AP)[1] = (__builtin_args_info (0) + __builtin_args_info (1)) * 4; }) +#endif + +/* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ +#define va_arg(AP, T) \ +( \ + ( \ + ((AP)[1] <= 48 && (__vpad ((AP)[1], T) > 48 || __vsiz (T) > 16)) \ + ? ((AP)[1] = 48 + __vsiz (T)) \ + : ((AP)[1] = __vpad ((AP)[1], T)) \ + ), \ + \ + *((T *) (void *) ((char *) *(AP) + (AP)[1] - __vsiz (T))) \ +) + +#ifndef va_end +void va_end (__gnuc_va_list); /* Defined in libgcc.a */ +#endif +#define va_end(AP) ((void *)0) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ + diff --git a/gnu/usr.bin/gcc/ginclude/va-m88k.h b/gnu/usr.bin/gcc/ginclude/va-m88k.h new file mode 100644 index 00000000000..7f8974b9c49 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-m88k.h @@ -0,0 +1,84 @@ +/* GNU C varargs support for the Motorola 88100 */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + +typedef struct +{ + int __va_arg; /* argument number */ + int *__va_stk; /* start of args passed on stack */ + int *__va_reg; /* start of args passed in regs */ +} __gnuc_va_list; +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +#ifdef _STDARG_H /* stdarg.h support */ + +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that LASTARG is correct. */ +#if __GNUC__ > 1 /* GCC 2.0 and beyond */ +#define va_start(AP,LASTARG) \ + (__builtin_next_arg (LASTARG), \ + (AP) = *(__gnuc_va_list *)__builtin_saveregs()) +#else +#define va_start(AP,LASTARG) \ + ( (AP).__va_reg = (int *) __builtin_saveregs2(0), \ + (AP).__va_stk = (int *) __builtin_argptr(), \ + (AP).__va_arg = (int) (__builtin_argsize() + 3) / 4 ) +#endif + +#else /* varargs.h support */ + +#if __GNUC__ > 1 /* GCC 2.0 and beyond */ +#define va_start(AP) ((AP) = *(__gnuc_va_list *)__builtin_saveregs()) +#else +#define va_start(AP) \ + ( (AP).__va_reg = (int *) __builtin_saveregs2(1), \ + (AP).__va_stk = (int *) __builtin_argptr(), \ + (AP).__va_arg = (int) (__builtin_argsize() - 4 + 3) / 4 ) +#endif +#define va_alist __va_1st_arg +#define va_dcl register int va_alist;... + +#endif /* _STDARG_H */ + +/* Avoid trouble between this file and _int_varargs.h under DG/UX. This file + can be included by <stdio.h> and others and provides definitions of + __va_size and __va_reg_p and a va_list typedef. Avoid defining va_list + again with _VA_LIST. */ +#ifdef __INT_VARARGS_H +#undef __va_size +#undef __va_reg_p +#define __gnuc_va_list va_list +#define _VA_LIST +#define _VA_LIST_ +#else +/* Similarly, if this gets included first, do nothing in _int_varargs.h. */ +#define __INT_VARARGS_H +#endif + +#define __va_reg_p(TYPE) \ + (__builtin_classify_type(*(TYPE *)0) < 12 \ + ? sizeof(TYPE) <= 8 : sizeof(TYPE) == 4 && __alignof__(TYPE) == 4) + +#define __va_size(TYPE) ((sizeof(TYPE) + 3) >> 2) + +/* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ +#define va_arg(AP,TYPE) \ + ( (AP).__va_arg = (((AP).__va_arg + (1 << (__alignof__(TYPE) >> 3)) - 1) \ + & ~((1 << (__alignof__(TYPE) >> 3)) - 1)) \ + + __va_size(TYPE), \ + *((TYPE *) (void *) ((__va_reg_p(TYPE) \ + && (AP).__va_arg < 8 + __va_size(TYPE) \ + ? (AP).__va_reg : (AP).__va_stk) \ + + ((AP).__va_arg - __va_size(TYPE))))) + +#define va_end(AP) ((void)0) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/gnu/usr.bin/gcc/ginclude/va-mips.h b/gnu/usr.bin/gcc/ginclude/va-mips.h new file mode 100644 index 00000000000..3cf1c920af5 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-mips.h @@ -0,0 +1,110 @@ +/* ---------------------------------------- */ +/* VARARGS for MIPS/GNU CC */ +/* */ +/* */ +/* */ +/* */ +/* ---------------------------------------- */ + + +/* These macros implement varargs for GNU C--either traditional or ANSI. */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +typedef char * __gnuc_va_list; +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +/* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + +#if __GNUC__ > 1 +#define __va_ellipsis ... +#else +#define __va_ellipsis +#endif + +#ifdef __mips64 +#define __va_rounded_size(__TYPE) \ + (((sizeof (__TYPE) + 8 - 1) / 8) * 8) +#else +#define __va_rounded_size(__TYPE) \ + (((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) +#endif + +/* Get definitions for _MIPS_SIM_ABI64 etc. */ +#ifdef _MIPS_SIM +#include <sgidefs.h> +#endif + +#ifdef _STDARG_H +#define va_start(__AP, __LASTARG) \ + (__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG)) + +#else +#define va_alist __builtin_va_alist +#ifdef __mips64 +/* This assumes that `long long int' is always a 64 bit type. */ +#define va_dcl long long int __builtin_va_alist; __va_ellipsis +#else +#define va_dcl int __builtin_va_alist; __va_ellipsis +#endif +/* Need alternate code for _MIPS_SIM_ABI64. */ +#if defined(_MIPS_SIM) && (_MIPS_SIM == _MIPS_SIM_ABI64) +#define va_start(__AP) \ + (__AP = (__gnuc_va_list) __builtin_next_arg () \ + + (__builtin_args_info (2) >= 8 ? -8 : 0)) +#else +#define va_start(__AP) __AP = (char *) &__builtin_va_alist +#endif +#endif + +#ifndef va_end +void va_end (__gnuc_va_list); /* Defined in libgcc.a */ +#endif +#define va_end(__AP) ((void)0) + +/* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ +/* The __mips64 cases are reversed from the 32 bit cases, because the standard + 32 bit calling convention left-aligns all parameters smaller than a word, + whereas the __mips64 calling convention does not (and hence they are + right aligned). */ +#ifdef __mips64 +#ifdef __MIPSEB__ +#define va_arg(__AP, __type) \ + ((__type *) (void *) (__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \ + + __va_rounded_size (__type))))[-1] +#else +#define va_arg(__AP, __type) \ + ((__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \ + + __va_rounded_size (__type))), \ + *(__type *) (void *) (__AP - __va_rounded_size (__type))) +#endif + +#else /* not __mips64 */ + +#ifdef __MIPSEB__ +/* For big-endian machines. */ +#define va_arg(__AP, __type) \ + ((__AP = (char *) ((__alignof__ (__type) > 4 \ + ? ((int)__AP + 8 - 1) & -8 \ + : ((int)__AP + 4 - 1) & -4) \ + + __va_rounded_size (__type))), \ + *(__type *) (void *) (__AP - __va_rounded_size (__type))) +#else +/* For little-endian machines. */ +#define va_arg(__AP, __type) \ + ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \ + ? ((int)__AP + 8 - 1) & -8 \ + : ((int)__AP + 4 - 1) & -4) \ + + __va_rounded_size(__type))))[-1] +#endif +#endif + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/gnu/usr.bin/gcc/ginclude/va-pa.h b/gnu/usr.bin/gcc/ginclude/va-pa.h new file mode 100644 index 00000000000..b6b81dd0925 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-pa.h @@ -0,0 +1,49 @@ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + +typedef double *__gnuc_va_list; +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) +#if __GNUC__ > 1 +#define __va_ellipsis ... +#define __gnuc_va_start(AP) ((AP) = (va_list)__builtin_saveregs()) +#else +#define va_alist __va_a__, __va_b__, __va_c__, __va_d__ +#define __va_ellipsis +#define __gnuc_va_start(AP)\ + (AP) = (double *) &__va_a__, &__va_b__, &__va_c__, &__va_d__, \ + (AP) = (double *)((char *)(AP) + 4) +#endif /* __GNUC__ > 1 */ + +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that LASTARG is correct. */ +#ifdef _STDARG_H +#define va_start(AP,LASTARG) \ + (__builtin_next_arg (LASTARG), __gnuc_va_start (AP)) +#else +/* The ... causes current_function_varargs to be set in cc1. */ +#define va_dcl long va_alist; __va_ellipsis +#define va_start(AP) __gnuc_va_start (AP) +#endif + +#define va_arg(AP,TYPE) \ + (*(sizeof(TYPE) > 8 ? \ + ((AP = (__gnuc_va_list) ((char *)AP - sizeof (int))), \ + (((TYPE *) (void *) (*((int *) (AP)))))) \ + :((AP = \ + (__gnuc_va_list) ((long)((char *)AP - sizeof (TYPE)) \ + & (sizeof(TYPE) > 4 ? ~0x7 : ~0x3))), \ + (((TYPE *) (void *) ((char *)AP + ((8 - sizeof(TYPE)) % 4))))))) + +#ifndef va_end +void va_end (__gnuc_va_list); /* Defined in libgcc.a */ +#endif +#define va_end(AP) ((void)0) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/gnu/usr.bin/gcc/ginclude/va-ppc.h b/gnu/usr.bin/gcc/ginclude/va-ppc.h new file mode 100644 index 00000000000..09f11e0d298 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-ppc.h @@ -0,0 +1,144 @@ +/* GNU C varargs support for the PowerPC with V.4 calling sequence */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + +/* Note that the names in this structure are in the user's namespace, but + that the V.4 abi explicitly states that these names should be used. */ +typedef struct { + char gpr; /* index into the array of 8 GPRs stored in the + register save area gpr=0 corresponds to r3, + gpr=1 to r4, etc. */ + char fpr; /* index into the array of 8 FPRs stored in the + register save area fpr=0 corresponds to f1, + fpr=1 to f2, etc. */ + char *overflow_arg_area; /* location on stack that holds the next + overflow argument */ + char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */ +} __gnuc_va_list[1]; +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +/* Register save area located below the frame pointer */ +typedef struct { + long __gp_save[8]; /* save area for GP registers */ + double __fp_save[8]; /* save area for FP registers */ +} __va_regsave_t; + +/* Macros to access the register save area */ +/* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ +#define __VA_FP_REGSAVE(AP,TYPE) \ + ((TYPE *) (void *) (&(((__va_regsave_t *) \ + (AP)->reg_save_area)->__fp_save[(int)(AP)->fpr]))) + +#define __VA_GP_REGSAVE(AP,TYPE) \ + ((TYPE *) (void *) (&(((__va_regsave_t *) \ + (AP)->reg_save_area)->__gp_save[(int)(AP)->gpr]))) + +/* Common code for va_start for both varargs and stdarg. This depends + on the format of rs6000_args in rs6000.h. The fields used are: + + #0 WORDS # words used for GP regs/stack values + #1 FREGNO next available FP register + #2 NARGS_PROTOTYPE # args left in the current prototype + #3 ORIG_NARGS original value of NARGS_PROTOTYPE + #4 VARARGS_OFFSET offset from frame pointer of varargs area */ + +#define __va_words __builtin_args_info (0) +#define __va_fregno __builtin_args_info (1) +#define __va_nargs __builtin_args_info (2) +#define __va_orig_nargs __builtin_args_info (3) +#define __va_varargs_offset __builtin_args_info (4) + +#define __va_start_common(AP, FAKE) \ +__extension__ ({ \ + register int __words = __va_words - FAKE; \ + \ + (AP)->gpr = (__words < 8) ? __words : 8; \ + (AP)->fpr = __va_fregno - 33; \ + (AP)->reg_save_area = (((char *) __builtin_frame_address (0)) \ + + __va_varargs_offset); \ + (AP)->overflow_arg_area = ((char *)__builtin_saveregs () \ + + (((__words >= 8) ? __words - 8 : 0) \ + * sizeof (long))); \ + (void)0; \ +}) + +#ifdef _STDARG_H /* stdarg.h support */ + +/* Calling __builtin_next_arg gives the proper error message if LASTARG is + not indeed the last argument. */ +#define va_start(AP,LASTARG) \ + (__builtin_next_arg (LASTARG), __va_start_common (AP, 0)) + +#else /* varargs.h support */ + +#define va_start(AP) __va_start_common (AP, 1) +#define va_alist __va_1st_arg +#define va_dcl register int va_alist; ... + +#endif /* _STDARG_H */ + +#ifdef _SOFT_FLOAT +#define __va_float_p(TYPE) 0 +#else +#define __va_float_p(TYPE) (__builtin_classify_type(*(TYPE *)0) == 8) +#endif + +#define __va_aggregate_p(TYPE) (__builtin_classify_type(*(TYPE *)0) >= 12) +#define __va_size(TYPE) ((sizeof(TYPE) + sizeof (long) - 1) / sizeof (long)) + +#define va_arg(AP,TYPE) \ +__extension__ (*({ \ + register TYPE *__ptr; \ + \ + if (__va_float_p (TYPE) && (AP)->fpr < 8) \ + { \ + __ptr = __VA_FP_REGSAVE (AP, TYPE); \ + (AP)->fpr++; \ + } \ + \ + else if (__va_aggregate_p (TYPE) && (AP)->gpr < 8) \ + { \ + __ptr = * __VA_GP_REGSAVE (AP, TYPE *); \ + (AP)->gpr++; \ + } \ + \ + else if (!__va_float_p (TYPE) && !__va_aggregate_p (TYPE) \ + && (AP)->gpr + __va_size(TYPE) <= 8) \ + { \ + __ptr = __VA_GP_REGSAVE (AP, TYPE); \ + (AP)->gpr += __va_size (TYPE); \ + } \ + \ + else if (!__va_float_p (TYPE) && !__va_aggregate_p (TYPE) \ + && (AP)->gpr < 8) \ + { \ + (AP)->gpr = 8; \ + __ptr = (TYPE *) (void *) ((AP)->overflow_arg_area); \ + (AP)->overflow_arg_area += __va_size (TYPE) * sizeof (long); \ + } \ + \ + else if (__va_aggregate_p (TYPE)) \ + { \ + __ptr = * (TYPE **) (void *) ((AP)->overflow_arg_area); \ + (AP)->overflow_arg_area += sizeof (TYPE *); \ + } \ + else \ + { \ + __ptr = (TYPE *) (void *) ((AP)->overflow_arg_area); \ + (AP)->overflow_arg_area += __va_size (TYPE) * sizeof (long); \ + } \ + \ + __ptr; \ +})) + +#define va_end(AP) ((void)0) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/gnu/usr.bin/gcc/ginclude/va-pyr.h b/gnu/usr.bin/gcc/ginclude/va-pyr.h new file mode 100644 index 00000000000..5ad4ba9d763 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-pyr.h @@ -0,0 +1,130 @@ +/** + * + * Varargs for PYR/GNU CC + * + * WARNING -- WARNING -- DANGER + * + * The code in this file implements varargs for gcc on a pyr in + * a way that is compatible with code compiled by the Pyramid Technology + * C compiler. + * As such, it depends strongly on the Pyramid conventions for + * parameter passing.ct and independent implementation. + * These (somewhat bizarre) parameter-passing conventions are described + * in the ``OSx Operating System Porting Guide''. + * + * A quick summary is useful: + * 12 of the 48 register-windowed regs available for + * parameter passing. Parameters of a function call that are eligible + * to be passed in registers are assigned registers from TR0/PR0 onwards; + * all other arguments are passed on the stack. + * Structure and union parameters are *never* passed in registers, + * even if they are small enough to fit. They are always passed on + * the stack. + * + * Double-sized parameters cannot be passed in TR11, because + * TR12 is not used for passing parameters. If, in the absence of this + * rule, a double-sized param would have been passed in TR11, + * that parameter is passed on the stack and no parameters are + * passed in TR11. + * + * It is only known to work for passing 32-bit integer quantities + * (ie chars, shorts, ints/enums, longs), doubles, or pointers. + * Passing structures on a Pyramid via varargs is a loser. + * Passing an object larger than 8 bytes on a pyramid via varargs may + * also be a loser. + * + */ + + +/* + * pointer to next stack parameter in __va_buf[0] + * pointer to next parameter register in __va_buf[1] + * Count of registers seen at __va_buf[2] + * saved pr0..pr11 in __va_buf[3..14] + * # of calls to va_arg (debugging) at __va_buf[15] + */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + +typedef void *__voidptr; +#if 1 + +typedef struct __va_regs { + __voidptr __stackp,__regp,__count; + __voidptr __pr0,__pr1,__pr2,__pr3,__pr4,__pr5,__pr6,__pr7,__pr8,__pr9,__pr10,__pr11; + } __va_regs; + +typedef __va_regs __va_buf; +#else + +/* __va_buf[0] = address of next arg passed on the stack + __va_buf[1] = address of next arg passed in a register + __va_buf[2] = register-# of next arg passed in a register + */ +typedef __voidptr(*__va_buf); + +#endif + +typedef __va_buf __gnuc_va_list; + +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +/* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + +#if __GNUC__ > 1 +#define __va_ellipsis ... +#else +#define __va_ellipsis +#endif + +#define va_alist \ + __va0,__va1,__va2,__va3,__va4,__va5,__va6,__va7,__va8,__va9,__va10,__va11, \ + __builtin_va_alist + +/* The ... causes current_function_varargs to be set in cc1. */ +#define va_dcl __voidptr va_alist; __va_ellipsis + + +/* __asm ("rcsp %0" : "=r" ( _AP [0]));*/ + +#define va_start(_AP) \ + _AP = ((struct __va_regs) { \ + &(_AP.__pr0), (void*)&__builtin_va_alist, (void*)0, \ + __va0,__va1,__va2,__va3,__va4,__va5, \ + __va6,__va7,__va8,__va9,__va10,__va11}) + + +/* Avoid errors if compiling GCC v2 with GCC v1. */ +#if __GNUC__ == 1 +#define __extension__ +#endif + +/* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ +#define va_arg(_AP, _MODE) \ +__extension__ \ +(*({__voidptr *__ap = (__voidptr*)&_AP; \ + register int __size = sizeof (_MODE); \ + register int __onstack = \ + (__size > 8 || ( (int)(__ap[2]) > 11) || \ + (__size==8 && (int)(__ap[2])==11)); \ + register int* __param_addr = ((int*)((__ap) [__onstack])); \ + \ + ((void *)__ap[__onstack])+=__size; \ + if (__onstack==0 || (int)(__ap[2])==11) \ + __ap[2]+= (__size >> 2); \ + (( _MODE *) (void *) __param_addr); \ +})) + +void va_end (__gnuc_va_list); /* Defined in libgcc.a */ +#define va_end(_X) ((void)0) + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/gnu/usr.bin/gcc/ginclude/va-sparc.h b/gnu/usr.bin/gcc/ginclude/va-sparc.h new file mode 100644 index 00000000000..40a24044033 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-sparc.h @@ -0,0 +1,203 @@ +/* This is just like the default gvarargs.h + except for differences described below. */ + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST + +#ifdef __sparc_v9__ +typedef long long __va_greg; +typedef double __va_freg; +typedef struct { + __va_greg * __va_next_o; /* next available %o* register */ + __va_greg * __va_next_o_limit; /* past last available %o* register */ + __va_freg * __va_next_fp; /* next available %f* register */ + __va_freg * __va_next_fp_limit; /* last available %f* register */ + __va_greg * __va_next_stack; /* next extended word on stack */ +} __gnuc_va_list; +#else +#ifndef __svr4__ +/* This has to be a char * to be compatible with Sun. + i.e., we have to pass a `va_list' to vsprintf. */ +typedef char * __gnuc_va_list; +#else +/* This has to be a void * to be compatible with Sun svr4. + i.e., we have to pass a `va_list' to vsprintf. */ +typedef void * __gnuc_va_list; +#endif +#endif /* not __sparc_v9__ */ +#endif /* not __GNUC_VA_LIST */ + +/* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ +#if defined (_STDARG_H) || defined (_VARARGS_H) + +#ifdef _STDARG_H + +#ifdef __sparc_v9__ +#define va_start(AP, LASTARG) \ +__extension__ \ + ({ \ + AP.__va_next_o = (__va_greg *) __builtin_saveregs (); \ + AP.__va_next_o_limit = (AP.__va_next_o + \ + (__builtin_args_info (0) < 6 ? 6 - __builtin_args_info (0) : 0)); \ + AP.__va_next_fp = (__va_freg *) AP.__va_next_o_limit; \ + AP.__va_next_fp_limit = (AP.__va_next_fp + \ + (__builtin_args_info (1) < 16 ? (16 - __builtin_args_info (1) + 1) / 2 : 0)); \ + AP.__va_next_stack = (__va_greg *) __builtin_next_arg (LASTARG); \ + }) +#else +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that LASTARG is correct. */ +#ifdef __GCC_NEW_VARARGS__ +#define va_start(AP, LASTARG) \ + (__builtin_next_arg (LASTARG), AP = (char *) __builtin_saveregs ()) +#else +#define va_start(AP, LASTARG) \ + (__builtin_saveregs (), AP = ((char *) __builtin_next_arg (LASTARG))) +#endif +#endif /* not __sparc_v9__ */ + +#else + +#define va_alist __builtin_va_alist +#define va_dcl int __builtin_va_alist;... + +#ifdef __sparc_v9__ +#define va_start(AP) \ +__extension__ \ + ({ \ + AP.__va_next_o = (__va_greg *) __builtin_saveregs (); \ + AP.__va_next_o_limit = (AP.__va_next_o + \ + (__builtin_args_info (0) < 6 ? 6 - __builtin_args_info (0) : 0)); \ + AP.__va_next_fp = (__va_freg *) AP.__va_next_o_limit; \ + AP.__va_next_fp_limit = (AP.__va_next_fp + \ + (__builtin_args_info (1) < 16 ? (16 - __builtin_args_info (1) + 1) / 2 : 0)); \ + AP.__va_next_stack = (__va_greg *) __builtin_next_arg (__builtin_va_alist) \ + - (__builtin_args_info (0) >= 6 || __builtin_args_info (1) >= 16 ? 1 : 0); \ + }) +#else +#ifdef __GCC_NEW_VARARGS__ +#define va_start(AP) ((AP) = (char *) __builtin_saveregs ()) +#else +#define va_start(AP) \ + (__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist)) +#endif +#endif /* not __sparc_v9__ */ + +#endif + +#ifndef va_end +void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + +/* Values returned by __builtin_classify_type. */ + +enum __va_type_classes { + __no_type_class = -1, + __void_type_class, + __integer_type_class, + __char_type_class, + __enumeral_type_class, + __boolean_type_class, + __pointer_type_class, + __reference_type_class, + __offset_type_class, + __real_type_class, + __complex_type_class, + __function_type_class, + __method_type_class, + __record_type_class, + __union_type_class, + __array_type_class, + __string_type_class, + __set_type_class, + __file_type_class, + __lang_type_class +}; + +#endif +#define va_end(pvar) ((void)0) + +/* Avoid errors if compiling GCC v2 with GCC v1. */ +#if __GNUC__ == 1 +#define __extension__ +#endif + +/* RECORD_TYPE args passed using the C calling convention are + passed by invisible reference. ??? RECORD_TYPE args passed + in the stack are made to be word-aligned; for an aggregate that is + not word-aligned, we advance the pointer to the first non-reg slot. */ + +#ifdef __sparc_v9__ + +#define va_arg(pvar,TYPE) \ +__extension__ \ +(*({int __type = __builtin_classify_type (* (TYPE *) 0); \ + void * __result; \ + if (__type == __real_type_class) /* float? */ \ + { \ + __va_freg *__r; \ + /* see PASS_IN_REG_P in gcc's sparc.h */ \ + if (pvar.__va_next_fp < pvar.__va_next_fp_limit \ + && ((__r = (__va_freg *) (((__va_greg) pvar.__va_next_fp + sizeof (TYPE) - 1) & ~(__va_greg) (sizeof (TYPE) - 1))) \ + < pvar.__va_next_fp_limit)) \ + { \ + pvar.__va_next_fp = __r + (sizeof (TYPE) + 7) / 8; \ + } \ + else \ + { \ + __r = (__va_freg *) pvar.__va_next_stack; \ + pvar.__va_next_stack += (sizeof (TYPE) + 7) / 8; \ + } \ + __result = __r; \ + } \ + else if (__type < __record_type_class) /* integer? */ \ + { \ + __va_greg *__r; \ + if (pvar.__va_next_o < pvar.__va_next_o_limit) \ + __r = pvar.__va_next_o++; \ + else \ + __r = pvar.__va_next_stack++; \ + /* adjust for 4 byte ints */ \ + __result = (char *) __r + 8 - sizeof (TYPE); \ + } \ + else /* aggregate object */ \ + { \ + void **__r; \ + if (pvar.__va_next_o < pvar.__va_next_o_limit) \ + __r = (void **) pvar.__va_next_o++; \ + else \ + __r = (void **) pvar.__va_next_stack++; \ + __result = *__r; \ + } \ + (TYPE *) __result;})) + +#else /* not __sparc_v9__ */ + +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) + +/* We don't declare the union member `d' to have type TYPE + because that would lose in C++ if TYPE has a constructor. */ +/* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. + The casts to char * avoid warnings about invalid pointer arithmetic. */ +#define va_arg(pvar,TYPE) \ +__extension__ \ +(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \ + || (__builtin_classify_type (*(TYPE*) 0) == __real_type_class \ + && sizeof (TYPE) == 16)) \ + ? ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE *), \ + *(TYPE **) (void *) ((char *)(pvar) - __va_rounded_size (TYPE *))) \ + : __va_rounded_size (TYPE) == 8 \ + ? ({ union {char __d[sizeof (TYPE)]; int __i[2];} __u; \ + __u.__i[0] = ((int *) (void *) (pvar))[0]; \ + __u.__i[1] = ((int *) (void *) (pvar))[1]; \ + (pvar) = (char *)(pvar) + 8; \ + (TYPE *) (void *) __u.__d; }) \ + : ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE), \ + ((TYPE *) (void *) ((char *)(pvar) - __va_rounded_size (TYPE)))));})) +#endif /* not __sparc_v9__ */ + +#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff --git a/gnu/usr.bin/gcc/ginclude/va-spur.h b/gnu/usr.bin/gcc/ginclude/va-spur.h new file mode 100644 index 00000000000..68cbc5ced64 --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/va-spur.h @@ -0,0 +1,61 @@ +/* varargs.h for SPUR */ + +/* NB. This is NOT the definition needed for the new ANSI proposed + standard */ + + +struct __va_struct { char __regs[20]; }; + +#define va_alist __va_regs, __va_stack + +/* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + +#if __GNUC__ > 1 +#define __va_ellipsis ... +#else +#define __va_ellipsis +#endif + +/* The ... causes current_function_varargs to be set in cc1. */ +#define va_dcl struct __va_struct __va_regs; int __va_stack; + +typedef struct { + int __pnt; + char *__regs; + char *__stack; +} va_list; + +#define va_start(pvar) \ + ((pvar).__pnt = 0, (pvar).__regs = __va_regs.__regs, \ + (pvar).__stack = (char *) &__va_stack) +#define va_end(pvar) ((void)0) + +/* Avoid errors if compiling GCC v2 with GCC v1. */ +#if __GNUC__ == 1 +#define __extension__ +#endif + +#define va_arg(pvar,type) \ +__extension__ \ + (*({ type *__va_result; \ + if ((pvar).__pnt >= 20) { \ + __va_result = ( (type *) ((pvar).__stack + (pvar).__pnt - 20)); \ + (pvar).__pnt += (sizeof(type) + 7) & ~7; \ + } \ + else if ((pvar).__pnt + sizeof(type) > 20) { \ + __va_result = (type *) (pvar).__stack; \ + (pvar).__pnt = 20 + ( (sizeof(type) + 7) & ~7); \ + } \ + else if (sizeof(type) == 8) { \ + union {double d; int i[2];} __u; \ + __u.i[0] = *(int *) ((pvar).__regs + (pvar).__pnt); \ + __u.i[1] = *(int *) ((pvar).__regs + (pvar).__pnt + 4); \ + __va_result = (type *) &__u; \ + (pvar).__pnt += 8; \ + } \ + else { \ + __va_result = (type *) ((pvar).__regs + (pvar).__pnt); \ + (pvar).__pnt += (sizeof(type) + 3) & ~3; \ + } \ + __va_result; })) diff --git a/gnu/usr.bin/gcc/ginclude/varargs.h b/gnu/usr.bin/gcc/ginclude/varargs.h new file mode 100644 index 00000000000..691759e99ac --- /dev/null +++ b/gnu/usr.bin/gcc/ginclude/varargs.h @@ -0,0 +1,190 @@ +/* Record that this is varargs.h; this turns off stdarg.h. */ + +#ifndef _VARARGS_H +#define _VARARGS_H + +#ifdef __sparc__ +#include <va-sparc.h> +#else +#ifdef __spur__ +#include <va-spur.h> +#else +#ifdef __mips__ +#include <va-mips.h> +#else +#ifdef __i860__ +#include <va-i860.h> +#else +#ifdef __pyr__ +#include <va-pyr.h> +#else +#ifdef __clipper__ +#include <va-clipper.h> +#else +#ifdef __m88k__ +#include <va-m88k.h> +#else +#if defined(__hppa__) || defined(hp800) +#include <va-pa.h> +#else +#ifdef __i960__ +#include <va-i960.h> +#else +#ifdef __alpha__ +#include <va-alpha.h> +#else +#if defined (__H8300__) || defined (__H8300H__) +#include <va-h8300.h> +#else +#if defined (__PPC__) && defined (_CALL_SYSV) +#include <va-ppc.h> +#else + +#ifdef __NeXT__ + +/* On Next, erase any vestiges of stdarg.h. */ + +#ifdef _ANSI_STDARG_H_ +#define _VA_LIST_ +#endif +#define _ANSI_STDARG_H_ + +#undef va_alist +#undef va_dcl +#undef va_list +#undef va_start +#undef va_end +#undef __va_rounded_size +#undef va_arg +#endif /* __NeXT__ */ + +/* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + +#if __GNUC__ > 1 +#define __va_ellipsis ... +#else +#define __va_ellipsis +#endif + +/* These macros implement traditional (non-ANSI) varargs + for GNU C. */ + +#define va_alist __builtin_va_alist +/* The ... causes current_function_varargs to be set in cc1. */ +#define va_dcl int __builtin_va_alist; __va_ellipsis + +/* Define __gnuc_va_list, just as in gstdarg.h. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) +typedef char *__gnuc_va_list; +#else +typedef void *__gnuc_va_list; +#endif +#endif + +#define va_start(AP) AP=(char *) &__builtin_va_alist + +#define va_end(AP) ((void)0) + +#if defined(sysV68) +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (short) - 1) / sizeof (short)) * sizeof (short)) +#else +#define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) +#endif + +#if defined (__arm__) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__) +/* This is for little-endian machines; small args are padded upward. */ +#define va_arg(AP, TYPE) \ + (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ + *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) +#else /* big-endian */ +/* This is for big-endian machines; small args are padded downward. */ +#define va_arg(AP, TYPE) \ + (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ + *((TYPE *) (void *) ((char *) (AP) \ + - ((sizeof (TYPE) < __va_rounded_size (char) \ + ? sizeof (TYPE) : __va_rounded_size (TYPE)))))) +#endif /* big-endian */ + +#endif /* not powerpc with V.4 calling sequence */ +#endif /* not h8300 */ +#endif /* not alpha */ +#endif /* not i960 */ +#endif /* not hppa */ +#endif /* not m88k */ +#endif /* not clipper */ +#endif /* not pyr */ +#endif /* not i860 */ +#endif /* not mips */ +#endif /* not spur */ +#endif /* not sparc */ +#endif /* not _VARARGS_H */ + +/* Define va_list from __gnuc_va_list. */ + +#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */ +#undef _VA_LIST +#endif + +#ifdef __svr4__ +/* SVR4.2 uses _VA_LIST for an internal alias for va_list, + so we must avoid testing it and setting it here. + SVR4 uses _VA_LIST as a flag in stdarg.h, but we should + have no conflict with that. */ +#ifndef _VA_LIST_ +#define _VA_LIST_ +#ifdef __i860__ +#ifndef _VA_LIST +#define _VA_LIST va_list +#endif +#endif /* __i860__ */ +typedef __gnuc_va_list va_list; +#endif /* _VA_LIST_ */ + +#else /* not __svr4__ */ + +/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. + But on BSD NET2 we must not test or define or undef it. + (Note that the comments in NET 2's ansi.h + are incorrect for _VA_LIST_--see stdio.h!) */ +/* Michael Eriksson <mer@sics.se> at Thu Sep 30 11:00:57 1993: + Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to + use for va_list (``typedef _VA_LIST_ va_list'') */ +#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) +/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ +#ifndef _VA_LIST_DEFINED +/* The macro _VA_LIST is used in SCO Unix 3.2. */ +#ifndef _VA_LIST +/* The macro _VA_LIST_T_H is used in the Bull dpx2 */ +#ifndef _VA_LIST_T_H +typedef __gnuc_va_list va_list; +#endif /* not _VA_LIST_T_H */ +#endif /* not _VA_LIST */ +#endif /* not _VA_LIST_DEFINED */ +#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) +#define _VA_LIST_ +#endif +#ifndef _VA_LIST +#define _VA_LIST +#endif +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED +#endif +#ifndef _VA_LIST_T_H +#define _VA_LIST_T_H +#endif + +#endif /* not _VA_LIST_, except on certain systems */ + +#endif /* not __svr4__ */ + +/* The next BSD release (if there is one) wants this symbol to be + undefined instead of _VA_LIST_. */ +#ifdef _BSD_VA_LIST +#undef _BSD_VA_LIST +#endif |