Changeset 55cff86 in mainline for libc/include/stdarg.h


Ignore:
Timestamp:
2006-03-15T12:36:49Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2345061
Parents:
d73942c
Message:

Fixed problem with stackarg/stdarg for 64-bit platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/include/stdarg.h

    rd73942c r55cff86  
    3030#define __LIBC__STDARG_H__
    3131
     32#include<types.h>
     33#include<stackarg.h>
     34
    3235#ifndef __VARARGS_DEFINED
    33 #define __VARARGS_DEFINED
     36# define __VARARGS_DEFINED
    3437
    35 /*
    36  * Variable argument list manipulation macros
    37  * for architectures using stack to pass arguments.
    38  */
    39  
    40 #include <types.h>
     38typedef __builtin_va_list va_list;
    4139
    42 typedef struct va_list {
    43         int pos;
    44         uint8_t *last;
    45 } va_list;
     40# define va_start(ap, last)             __builtin_va_start(ap, last)
     41# define va_arg(ap, type)               __builtin_va_arg(ap, type)
     42# define va_end(ap)                     __builtin_va_end(ap)
    4643
    47 #define va_start(ap, lst)               \
    48         (ap).pos = sizeof(lst);                         \
    49         (ap).last = (uint8_t *) &(lst)
    50 
    51 #define va_arg(ap, type)                \
    52         (*((type *)((ap).last + ((ap).pos  += sizeof(type) ) - sizeof(type))))
    53 
    54 #define va_end(ap)
     44# endif
    5545
    5646#endif
    57 
    58 
    59 #endif
Note: See TracChangeset for help on using the changeset viewer.