/uspace/trunk/libc/include/stdarg.h |
---|
29,18 → 29,31 |
#ifndef __LIBC__STDARG_H__ |
#define __LIBC__STDARG_H__ |
#include<types.h> |
#include<stackarg.h> |
#ifndef __VARARGS_DEFINED |
# define __VARARGS_DEFINED |
#define __VARARGS_DEFINED |
typedef __builtin_va_list va_list; |
/* |
* Variable argument list manipulation macros |
* for architectures using stack to pass arguments. |
*/ |
#include <types.h> |
# 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) |
typedef struct va_list { |
int pos; |
uint8_t *last; |
} va_list; |
# endif |
#define va_start(ap, lst) \ |
(ap).pos = sizeof(lst); \ |
(ap).last = (uint8_t *) &(lst) |
#define va_arg(ap, type) \ |
(*((type *)((ap).last + ((ap).pos += sizeof(type) ) - sizeof(type)))) |
#define va_end(ap) |
#endif |
#endif |
/uspace/trunk/libc/generic/io/print.c |
---|
203,8 → 203,7 |
counter += retval; |
break; |
case 'c': |
c = va_arg(ap, unsigned long); |
if ((retval = putnchars(&c, sizeof(char))) == EOF) { |
if ((retval = putnchars((char *)&va_arg(ap, unsigned long), sizeof(char))) == EOF) { |
return -counter; |
}; |
/uspace/trunk/libc/generic/io/io.c |
---|
67,10 → 67,6 |
{ |
size_t count; |
if (str == NULL) { |
return putnchars("(NULL)",6 ); |
} |
for (count = 0; str[count] != 0; count++); |
if (write(1, (void * ) str, count) == count) { |
return 0; |
/uspace/trunk/libc/arch/ia64/include/stackarg.h |
---|
File deleted |
/uspace/trunk/libc/arch/amd64/include/stackarg.h |
---|
File deleted |
/uspace/trunk/libc/arch/mips32/include/stackarg.h |
---|
File deleted |
/uspace/trunk/libc/arch/ia32/include/stackarg.h |
---|
File deleted |