david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[libc] Use __builtin_va_list et al in stdarg.h

The home-grown versions don't work properly for static variadic
functions, when gcc can choose to use a non-standard calling convention.
This commit is contained in:
Michael Brown 2008-03-24 00:23:11 +00:00
parent 23e077666b
commit dbf8a02e8f
2 changed files with 10 additions and 22 deletions

View File

@ -1,22 +0,0 @@
#ifndef _STDARG_H
#define _STDARG_H
typedef void * va_list;
#define va_start( ap, last ) do { \
ap = ( &last + 1 ); \
} while ( 0 )
#define va_arg( ap, type ) ({ \
type *_this = ap; \
ap = ( _this + 1 ); \
*(_this); \
})
#define va_end( ap ) do { } while ( 0 )
#define va_copy( dest, src ) do { \
dest = src; \
} while ( 0 )
#endif /* _STDARG_H */

10
src/include/stdarg.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef _STDARG_H
#define _STDARG_H
typedef __builtin_va_list va_list;
#define va_start( ap, last ) __builtin_va_start ( ap, last )
#define va_arg( ap, type ) __builtin_va_arg ( ap, type )
#define va_end( ap ) __builtin_va_end ( ap )
#define va_copy( dest, src ) __builtin_va_copy ( dest, src )
#endif /* _STDARG_H */