OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [uC-libc/] [include/] [stdarg.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
 /*
2
  * @(#) stdarg.h 1.2 91/11/30 21:10:39
3
  *
4
  * Sample stdarg.h file for use with the unproto filter.
5
  *
6
  * This file serves two purposes.
7
  *
8
  * 1 - As an include file for use with ANSI-style C source that implements
9
  * variadic functions.
10
  *
11
  * 2 - To configure the unproto filter itself. If the _VA_ALIST_ macro is
12
  * defined, its value will appear in the place of the "..." in argument
13
  * lists of variadic function *definitions* (not declarations).
14
  *
15
  * Compilers that pass arguments via the stack can use the default code at the
16
  * end of this file (this usually applies for the VAX, MC68k and 80*86
17
  * architectures).
18
  *
19
  * RISC-based systems often need special tricks. An example of the latter is
20
  * given for the SPARC architecture. Read your /usr/include/varargs.h for
21
  * more information.
22
  *
23
  * You can use the varargs.c program provided with the unproto package to
24
  * verify that the stdarg.h file has been set up correctly.
25
  */
26
 
27
#ifndef __STDARG_H
28
#define __STDARG_H
29
 
30
#ifdef sparc
31
#  define _VA_ALIST_            "__builtin_va_alist"
32
   typedef char *va_list;
33
#  define va_start(ap, p)       (ap = (char *) &__builtin_va_alist)
34
#  define va_arg(ap, type)      ((type *) __builtin_va_arg_incr((type *) ap))[0]
35
#  define va_end(ap)
36
#else /* vax, mc68k, 80*86 */
37
   typedef char *va_list;
38
#  define va_start(ap, p)       (ap = (char *) (&(p)+1))
39
#  define va_arg(ap, type)      ((type *) (ap += sizeof(type)))[-1]
40
#  define va_end(ap)
41
#endif
42
 
43
#endif /* __STDARG_H */
44
 
45
#if __FIRST_ARG_IN_AX__
46
#error First arg is in a register, stdarg.h cannot take its address
47
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.