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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [stdalone/] [twotasks-1/] [os/] [stdarg.h] - Blame information for rev 196

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 hellwig
/*
2
 * stdarg.h -- variable argument lists
3
 */
4
 
5
 
6
#ifndef _STDARG_H_
7
#define _STDARG_H_
8
 
9
 
10
typedef char *va_list;
11
 
12
 
13
static float __va_arg_tmp;
14
 
15
 
16
#define va_start(list, start) \
17
        ((void)((list) = (sizeof(start)<4 ? \
18
        (char *)((int *)&(start)+1) : (char *)(&(start)+1))))
19
 
20
#define __va_arg(list, mode, n) \
21
        (__typecode(mode)==1 && sizeof(mode)==4 ? \
22
        (__va_arg_tmp = *(double *)(&(list += \
23
        ((sizeof(double)+n)&~n))[-(int)((sizeof(double)+n)&~n)]), \
24
        *(mode *)&__va_arg_tmp) : \
25
        *(mode *)(&(list += \
26
        ((sizeof(mode)+n)&~n))[-(int)((sizeof(mode)+n)&~n)]))
27
 
28
#define _bigendian_va_arg(list, mode, n) \
29
        (sizeof(mode)==1 ? *(mode *)(&(list += 4)[-1]) : \
30
        sizeof(mode)==2 ? *(mode *)(&(list += 4)[-2]) : \
31
        __va_arg(list, mode, n))
32
 
33
#define va_end(list) ((void)0)
34
 
35
#define va_arg(list, mode) \
36
        (sizeof(mode)==8 ? \
37
        *(mode *)(&(list = (char*)(((int)list + 15)&~7U))[-8]) : \
38
        _bigendian_va_arg(list, mode, 3U))
39
 
40
 
41
#endif /* _STDARG_H_ */

powered by: WebSVN 2.1.0

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