Changeset 55cff86 in mainline


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.

Location:
libc
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • libc/generic/io/io.c

    rd73942c r55cff86  
    6868        size_t count;
    6969       
     70        if (str == NULL) {
     71                return putnchars("(NULL)",6 );
     72        }
     73
    7074        for (count = 0; str[count] != 0; count++);
    7175        if (write(1, (void * ) str, count) == count) {
  • libc/generic/io/print.c

    rd73942c r55cff86  
    204204                                        break;
    205205                                case 'c':
    206                                         if ((retval = putnchars((char *)&va_arg(ap, unsigned long), sizeof(char))) == EOF) {
     206                                        c = va_arg(ap, unsigned long);
     207                                        if ((retval = putnchars(&c, sizeof(char))) == EOF) {
    207208                                                return -counter;
    208209                                        };
  • 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.