Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions include/_PDCLIB_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,15 @@ struct _PDCLIB_imaxdiv_t
/* Internal helper macro. va_round is not part of <stdarg.h>. */
#define _PDCLIB_va_round( type ) ( (sizeof(type) + sizeof(void *) - 1) & ~(sizeof(void *) - 1) )

typedef char * _PDCLIB_va_list;
#define _PDCLIB_va_arg( ap, type ) ( (ap) += (_PDCLIB_va_round(type)), ( *(type*) ( (ap) - (_PDCLIB_va_round(type)) ) ) )
#define _PDCLIB_va_copy( dest, src ) ( (dest) = (src), (void)0 )
#define _PDCLIB_va_end( ap ) ( (ap) = (void *)0, (void)0 )
#define _PDCLIB_va_start( ap, parmN ) ( (ap) = (char *) &parmN + ( _PDCLIB_va_round(parmN) ), (void)0 )
/* arm-vita-eabi passes the first four words of a variadic call in
registers (AAPCS), so the stack-walking hack above -- which this file's
own comment already disclaims for non-stack-based architectures -- does
not locate them. Defer to the compiler's real va_list instead. */
typedef __builtin_va_list _PDCLIB_va_list;
#define _PDCLIB_va_arg( ap, type ) __builtin_va_arg( ap, type )
#define _PDCLIB_va_copy( dest, src ) __builtin_va_copy( dest, src )
#define _PDCLIB_va_end( ap ) __builtin_va_end( ap )
#define _PDCLIB_va_start( ap, parmN ) __builtin_va_start( ap, parmN )

/* -------------------------------------------------------------------------- */
/* OS "glue", part 1 */
Expand Down