X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=platform%2Fwin32%2Finternals%2F_PDCLIB_config.h;h=17c8ff4a74a1e7ff1d9f4c1ad21c924bcaa3f109;hp=27a87b9955b46fa50000c45600f1acbc8d81792b;hb=48b352165d2cb89126ddde1323a138820687970a;hpb=f2a7978ab6a39b01883b730155237a3555b28b57 diff --git a/platform/win32/internals/_PDCLIB_config.h b/platform/win32/internals/_PDCLIB_config.h index 27a87b9..17c8ff4 100644 --- a/platform/win32/internals/_PDCLIB_config.h +++ b/platform/win32/internals/_PDCLIB_config.h @@ -273,13 +273,22 @@ struct _PDCLIB_imaxdiv_t */ #ifdef __GNUC__ - typedef char * _PDCLIB_va_list; + 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) )) +#elif (defined(__i386__) || defined(__i386) || defined(_M_IX86)) && !(defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)) + /* Internal helper macro. va_round is not part of . */ + #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 ) #else - #error Compiler support please + #error Compiler/Architecture support please #endif /* -------------------------------------------------------------------------- */