X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Finternals%2F_PDCLIB_config.h;h=c6da3ef5a02afea68a3c4ab3aa36722bd7ea1398;hb=1d4e8006a01beb9e40b23fb8b58283fcc46c0757;hp=27a87b9955b46fa50000c45600f1acbc8d81792b;hpb=4808a96c310b742c21fcc3b41663b4071536f185;p=pdclib.old diff --git a/platform/win32/internals/_PDCLIB_config.h b/platform/win32/internals/_PDCLIB_config.h index 27a87b9..c6da3ef 100644 --- a/platform/win32/internals/_PDCLIB_config.h +++ b/platform/win32/internals/_PDCLIB_config.h @@ -27,12 +27,6 @@ /* specific platforms, e.g. by swapping int instead of char. */ #define _PDCLIB_memswp( i, j, size ) char tmp; do { tmp = *i; *i++ = *j; *j++ = tmp; } while ( --size ); -/* Define this to some compiler directive that can be written after the */ -/* parameter list of a function declaration to indicate the function does */ -/* never return. If your compiler does not support such a directive, define */ -/* to nothing. (This is to avoid warnings with the exit functions under GCC.) */ -#define _PDCLIB_NORETURN __attribute__(( noreturn )) - /* The maximum value that errno can be set to. This is used to set the size */ /* of the array in struct lconv () holding error messages for the */ /* strerror() and perror() functions. (If you change this value because you */ @@ -162,6 +156,7 @@ struct _PDCLIB_lldiv_t XX: Windows requires wchar_t be an unsigned short, but this is not compliant. */ +#define _PDCLIB_wint signed short #define _PDCLIB_wchar unsigned short #define _PDCLIB_WCHAR USHRT @@ -219,6 +214,19 @@ struct _PDCLIB_imaxdiv_t #define _PDCLIB_clock double #define _PDCLIB_CLOCKS_PER_SEC 1000000 +/* : TIME_UTC + * + * The TIME_UTC parameter is passed to the timespec_get function in order to get + * the system time in UTC since an implementation defined epoch (not necessarily + * the same as that used for time_t). That said, on POSIX the obvious + * implementation of timespec_get for TIME_UTC is to wrap + * clock_gettime(CLOCK_REALTIME, ...), which is defined as time in UTC since the + * same epoch. + * + * This may be any non-zero integer value. + */ +#define _PDCLIB_TIME_UTC 1 + /* -------------------------------------------------------------------------- */ /* Floating Point */ /* -------------------------------------------------------------------------- */ @@ -246,6 +254,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 +293,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 /* -------------------------------------------------------------------------- */ @@ -304,15 +333,15 @@ struct _PDCLIB_imaxdiv_t /* TODO: Better document these */ -/* I/O ---------------------------------------------------------------------- */ +/* Locale --------------------------------------------------------------------*/ -/* The type of the file descriptor returned by _PDCLIB_open(). */ -typedef void * _PDCLIB_fd_t; +/* Locale method. See _PDCLIB_locale.h */ +#define _PDCLIB_LOCALE_METHOD _PDCLIB_LOCALE_METHOD_TSS -/* The value (of type _PDCLIB_fd_t) returned by _PDCLIB_open() if the operation - failed. -*/ -#define _PDCLIB_NOHANDLE NULL +/* wchar_t encoding */ +#define _PDCLIB_WCHAR_ENCODING _PDCLIB_WCHAR_ENCODING_UTF16 + +/* I/O ---------------------------------------------------------------------- */ /* The default size for file buffers. Must be at least 256. */ #define _PDCLIB_BUFSIZ 1024 @@ -325,10 +354,10 @@ typedef void * _PDCLIB_fd_t; #define _PDCLIB_FOPEN_MAX 8 /* Length of the longest filename the implementation guarantees to support. */ -#define _PDCLIB_FILENAME_MAX 128 +#define _PDCLIB_FILENAME_MAX 260 /* Maximum length of filenames generated by tmpnam(). (See tmpfile.c.) */ -#define _PDCLIB_L_tmpnam 46 +#define _PDCLIB_L_tmpnam 260 /* Number of distinct file names that can be generated by tmpnam(). */ #define _PDCLIB_TMP_MAX 50