X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Finternals%2F_PDCLIB_config.h;h=81e13a67ff8c1d4f996b7e5593bb351951c206f8;hb=1755b59a8885757e3ceab7da3a35f7803905694c;hp=793065d6c6ec2656c155ca7f99667a62c485b69d;hpb=d8928b5f31bbdac23f9ec296ef28b4b10efa31d5;p=pdclib diff --git a/platform/win32/internals/_PDCLIB_config.h b/platform/win32/internals/_PDCLIB_config.h index 793065d..81e13a6 100644 --- a/platform/win32/internals/_PDCLIB_config.h +++ b/platform/win32/internals/_PDCLIB_config.h @@ -246,6 +246,18 @@ struct _PDCLIB_imaxdiv_t */ #define _PDCLIB_DECIMAL_DIG 17 +/* Floating point types + * + * PDCLib (at present) assumes IEEE 754 floating point formats + * The following names are used: + * SINGLE: IEEE 754 single precision (32-bit) + * DOUBLE: IEEE 754 double precision (64-bit) + * EXTENDED: IEEE 754 extended precision (80-bit, as x87) + */ +#define _PDCLIB_FLOAT_TYPE SINGLE +#define _PDCLIB_DOUBLE_TYPE DOUBLE +#define _PDCLIB_LDOUBLE_TYPE EXTENDED + /* -------------------------------------------------------------------------- */ /* Platform-dependent macros defined by the standard headers. */ /* -------------------------------------------------------------------------- */ @@ -273,13 +285,22 @@ struct _PDCLIB_imaxdiv_t */ #ifdef __GNUC__ + 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 ) __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 ) + #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 /* -------------------------------------------------------------------------- */ @@ -336,6 +357,8 @@ typedef void * _PDCLIB_fd_t; /* The values of SEEK_SET, SEEK_CUR and SEEK_END, used by fseek(). Since at least one platform (POSIX) uses the same symbols for its own "seek" function, we use whatever the host defines (if it does define them). + + Win32 note: Must match Win32 API values (FILE_BEGIN/FILE_CURRENT/FILE_END) */ #define _PDCLIB_SEEK_SET 0 #define _PDCLIB_SEEK_CUR 1