diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2002-03-22 22:35:38 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2002-03-22 22:35:38 +0000 |
commit | bf90ad419fca883965ee417f02d1863d6083a66f (patch) | |
tree | e1d03d16ac9733a45b1fc66ba0d3e46d414afa5e /winsup | |
parent | 56e52c8419036cc79077729ad9fc90b4d4236cfc (diff) | |
download | newlib-bf90ad419fca883965ee417f02d1863d6083a66f.zip newlib-bf90ad419fca883965ee417f02d1863d6083a66f.tar.gz newlib-bf90ad419fca883965ee417f02d1863d6083a66f.tar.bz2 |
Added fenv.h inttypes.h
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/mingw/include/fenv.h | 85 | ||||
-rw-r--r-- | winsup/mingw/include/inttypes.h | 275 | ||||
-rw-r--r-- | winsup/mingw/include/math.h | 243 | ||||
-rw-r--r-- | winsup/mingw/include/stdlib.h | 67 | ||||
-rw-r--r-- | winsup/mingw/include/wchar.h | 28 |
5 files changed, 692 insertions, 6 deletions
diff --git a/winsup/mingw/include/fenv.h b/winsup/mingw/include/fenv.h new file mode 100644 index 0000000..ddc43df --- /dev/null +++ b/winsup/mingw/include/fenv.h @@ -0,0 +1,85 @@ +#ifndef _FENV_H +#define _FENV_H + +/* + For now, support only for the basic abstraction of flags that are + either set or clear. fexcept_t could be structure that holds more info + about the fp environment. +*/ +typedef unsigned short fexcept_t; + +/* This 28-byte struct represents the entire floating point + environment as stored by fnstenv or fstenv */ +typedef struct +{ + unsigned short __control_word; + unsigned short __unused0; + unsigned short __status_word; + unsigned short __unused1; + unsigned short __tag_word; + unsigned short __unused2; + unsigned int __ip_offset; /* instruction pointer offset */ + unsigned short __ip_selector; + unsigned short __opcode; + unsigned int __data_offset; + unsigned short __data_selector; + unsigned short __unused3; +} fenv_t; + + +/* FPU status word exception flags */ +#define FE_INVALID 0x01 +#define FE_DENORMAL 0x02 +#define FE_DIVBYZERO 0x04 +#define FE_OVERFLOW 0x08 +#define FE_UNDERFLOW 0x10 +#define FE_INEXACT 0x20 +#define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \ + | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) + +/* FPU control word rounding flags */ +#define FE_TONEAREST 0x0000 +#define FE_DOWNWARD 0x0400 +#define FE_UPWARD 0x0800 +#define FE_TOWARDZERO 0x0c00 + + +/* The default floating point environment */ +#define FE_DFL_ENV ((const fenv_t *)-1) + + +#ifndef RC_INVOKED +#ifdef __cplusplus +extern "C" { +#endif + + +/*TODO: Some of these could be inlined */ +/* 7.6.2 Exception */ + +extern int feclearexcept (int); +extern int fegetexceptflag (fexcept_t * flagp, int excepts); +extern int feraiseexcept (int excepts ); +extern int fesetexceptflag (const fexcept_t *, int); +extern int fetestexcept (int excepts); + + +/* 7.6.3 Rounding */ + +extern int fegetround (void); +extern int fesetround (int mode); + + +/* 7.6.4 Environment */ + +extern int fegetenv (fenv_t * envp); +extern int fesetenv (const fenv_t * ); +extern int feupdateenv (const fenv_t *); +extern int feholdexcept (fenv_t *); + +#ifdef __cplusplus +} +#endif +#endif /* Not RC_INVOKED */ + +#endif /* ndef _FENV_H */ diff --git a/winsup/mingw/include/inttypes.h b/winsup/mingw/include/inttypes.h new file mode 100644 index 0000000..74944f1 --- /dev/null +++ b/winsup/mingw/include/inttypes.h @@ -0,0 +1,275 @@ +/* 7.8 Format conversion of integer types <inttypes.h> */ + +#ifndef _INTTYPES_H +#define _INTTYPES_H + +#include <stdint.h> +#define __need_wchar_t +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + intmax_t quot; + intmax_t rem; + } imaxdiv_t; + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) + +/* 7.8.1 Macros for format specifiers + * + * MS runtime does not yet understand C9x standard "ll" + * length specifier. It appears to treat "ll" as "l". + * The non-standard I64 length specifier causes warning in GCC, + * but understood by MS runtime functions. + */ + +/* fprintf macros for signed types */ +#define PRId8 "d" +#define PRId16 "d" +#define PRId32 "d" +#define PRId64 "I64d" + +#define PRIdLEAST8 "d" +#define PRIdLEAST16 "d" +#define PRIdLEAST32 "d" +#define PRIdLEAST64 "I64d" + +#define PRIdFAST8 "d" +#define PRIdFAST16 "d" +#define PRIdFAST32 "d" +#define PRIdFAST64 "I64d" + +#define PRIdMAX "I64d" +#define PRIdPTR "d" + +#define PRIi8 "i" +#define PRIi16 "i" +#define PRIi32 "i" +#define PRIi64 "I64i" + +#define PRIiLEAST8 "i" +#define PRIiLEAST16 "i" +#define PRIiLEAST32 "i" +#define PRIiLEAST64 "I64i" + +#define PRIiFAST8 "i" +#define PRIiFAST16 "i" +#define PRIiFAST32 "i" +#define PRIiFAST64 "I64i" + +#define PRIiMAX "I64i" +#define PRIiPTR "i" + +#define PRIo8 "o" +#define PRIo16 "o" +#define PRIo32 "o" +#define PRIo64 "I64o" + +#define PRIoLEAST8 "o" +#define PRIoLEAST16 "o" +#define PRIoLEAST32 "o" +#define PRIoLEAST64 "I64o" + +#define PRIoFAST8 "o" +#define PRIoFAST16 "o" +#define PRIoFAST32 "o" +#define PRIoFAST64 "I64o" + +#define PRIoMAX "I64o" + +#define PRIoPTR "o" + +/* fprintf macros for unsigned types */ +#define PRIu8 "u" +#define PRIu16 "u" +#define PRIu32 "u" +#define PRIu64 "I64u" + + +#define PRIuLEAST8 "u" +#define PRIuLEAST16 "u" +#define PRIuLEAST32 "u" +#define PRIuLEAST64 "I64u" + +#define PRIuFAST8 "u" +#define PRIuFAST16 "u" +#define PRIuFAST32 "u" +#define PRIuFAST64 "I64u" + +#define PRIuMAX "I64u" +#define PRIuPTR "u" + +#define PRIx8 "x" +#define PRIx16 "x" +#define PRIx32 "x" +#define PRIx64 "I64x" + +#define PRIxLEAST8 "x" +#define PRIxLEAST16 "x" +#define PRIxLEAST32 "x" +#define PRIxLEAST64 "I64x" + +#define PRIxFAST8 "x" +#define PRIxFAST16 "x" +#define PRIxFAST32 "x" +#define PRIxFAST64 "I64x" + +#define PRIxMAX "I64x" +#define PRIxPTR "x" + +#define PRIX8 "X" +#define PRIX16 "X" +#define PRIX32 "X" +#define PRIX64 "I64X" + +#define PRIXLEAST8 "X" +#define PRIXLEAST16 "X" +#define PRIXLEAST32 "X" +#define PRIXLEAST64 "I64X" + +#define PRIXFAST8 "X" +#define PRIXFAST16 "X" +#define PRIXFAST32 "X" +#define PRIXFAST64 "I64X" + +#define PRIXMAX "I64X" +#define PRIXPTR "X" + +/* + * fscanf macros for signed int types + * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t + * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have + * no length identifiers + */ + +#define SCNd16 "hd" +#define SCNd32 "d" +#define SCNd64 "I64d" + +#define SCNdLEAST16 "hd" +#define SCNdLEAST32 "d" +#define SCNdLEAST64 "I64d" + +#define SCNdFAST16 "hd" +#define SCNdFAST32 "d" +#define SCNdFAST64 "I64d" + +#define SCNdMAX "I64d" +#define SCNdPTR "d" + +#define SCNi16 "hi" +#define SCNi32 "i" +#define SCNi64 "I64i" + +#define SCNiLEAST16 "hi" +#define SCNiLEAST32 "i" +#define SCNiLEAST64 "I64i" + +#define SCNiFAST16 "hi" +#define SCNiFAST32 "i" +#define SCNiFAST64 "I64i" + +#define SCNiMAX "I64i" +#define SCNiPTR "i" + +#define SCNo16 "ho" +#define SCNo32 "o" +#define SCNo64 "I64o" + +#define SCNoLEAST16 "ho" +#define SCNoLEAST32 "o" +#define SCNoLEAST64 "I64o" + +#define SCNoFAST16 "ho" +#define SCNoFAST32 "o" +#define SCNoFAST64 "I64o" + +#define SCNoMAX "I64o" +#define SCNoPTR "o" + +#define SCNx16 "hx" +#define SCNx32 "x" +#define SCNx64 "I64x" + +#define SCNxLEAST16 "hx" +#define SCNxLEAST32 "x" +#define SCNxLEAST64 "I64x" + +#define SCNxFAST16 "hx" +#define SCNxFAST32 "x" +#define SCNxFAST64 "I64x" + +#define SCNxMAX "I64x" +#define SCNxPTR "x" + + +/* fscanf macros for unsigned int types */ + +#define SCNu16 "hu" +#define SCNu32 "u" +#define SCNu64 "I64u" + +#define SCNuLEAST16 "hu" +#define SCNuLEAST32 "u" +#define SCNuLEAST64 "I64u" + +#define SCNuFAST16 "hu" +#define SCNuFAST32 "u" +#define SCNuFAST64 "I64u" + +#define SCNuMAX "I64u" +#define SCNuPTR "u" + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* + * no length modifier for char types prior to C9x + * MS runtime scanf appears to treat "hh" as "h" + */ + +/* signed char */ +#define SCNd8 "hhd" +#define SCNdLEAST8 "hhd" +#define SCNdFAST8 "hhd" + +#define SCNi8 "hhi" +#define SCNiLEAST8 "hhi" +#define SCNiFAST8 "hhi" + +#define SCNo8 "hho" +#define SCNoLEAST8 "hho" +#define SCNoFAST8 "hho" + +#define SCNx8 "hhx" +#define SCNxLEAST8 "hhx" +#define SCNxFAST8 "hhx" + +/* unsigned char */ +#define SCNu8 "hhu" +#define SCNuLEAST8 "hhu" +#define SCNuFAST8 "hhu" +#endif /* __STDC_VERSION__ >= 199901 */ + +#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ + +extern inline intmax_t imaxabs (intmax_t j) + {return (j >= 0 ? j : -j);} +imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom); + +/* 7.8.2 Conversion functions for greatest-width integer types */ + +intmax_t strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base); +uintmax_t strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base); + +intmax_t wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, + int base); +uintmax_t wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, + int base); + +#ifdef __cplusplus +} +#endif + +#endif /* ndef _INTTYPES_H */ diff --git a/winsup/mingw/include/math.h b/winsup/mingw/include/math.h index 3fcaa1e..82f9173 100644 --- a/winsup/mingw/include/math.h +++ b/winsup/mingw/include/math.h @@ -51,6 +51,7 @@ around GCC build issues. */ #ifndef __MINGW_FPCLASS_DEFINED #define __MINGW_FPCLASS_DEFINED 1 +/* IEEE 754 classication */ #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ #define _FPCLASS_NINF 0x0004 /* Negative Infinity */ @@ -173,6 +174,26 @@ int _matherr (struct _exception *); /* These are also declared in Mingw float.h; needed here as well to work around GCC build issues. */ /* BEGIN FLOAT.H COPY */ + +/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask), + * i.e. change the bits in unMask to have the values they have in unNew, + * leaving other bits unchanged. */ +unsigned int _controlfp (unsigned int unNew, unsigned int unMask); +unsigned int _control87 (unsigned int unNew, unsigned int unMask); + + +unsigned int _clearfp (); /* Clear the FPU status word */ +unsigned int _statusfp (); /* Report the FPU status word */ +#define _clear87 _clearfp +#define _status87 _statusfp + +void _fpreset (); /* Reset the FPU */ +void fpreset (); + +/* Global 'variable' for the current floating point error code. */ +int * __fpecode(); +#define _fpecode (*(__fpecode())) + /* * IEEE recommended functions */ @@ -189,12 +210,15 @@ int _isnan (double); /* END FLOAT.H COPY */ -#ifndef _NO_OLDNAMES +#if !defined (_NO_OLDNAMES) \ + || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) /* * Non-underscored versions of non-ANSI functions. These reside in - * liboldnames.a. Provided for extra portability. + * liboldnames.a. They are now also ISO C99 standand names. + * Provided for extra portability. */ + double cabs (struct _complex); double hypot (double, double); double j0 (double); @@ -211,8 +235,223 @@ double yn (int, double); #ifdef __cplusplus } #endif +#endif /* Not RC_INVOKED */ + +#ifndef __NO_ISOCEXT + +#define INFINITY HUGE_VAL + +double nan(const char *tagp); +float nanf(const char *tagp); + +#ifndef __STRICT_ANSI__ +#define nan() nan("") +#define nanf() nanf("") +#endif + +#define NAN (0.0F/0.0F) + +/* + Return values for fpclassify. + These are based on Intel x87 fpu condition codes + in the high byte of status word and differ from + the return values for MS IEEE 754 extension _fpclass() +*/ +#define FP_NAN 0x0100 +#define FP_NORMAL 0x0400 +#define FP_INFINITE (FP_NAN | FP_NORMAL) +#define FP_ZERO 0x4000 +#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO) +/* 0x0200 is signbit mask */ + +#ifndef RC_INVOKED +#ifdef __cplusplus +extern "C" { +#endif + +/* + We can't inline float, because we want to ensure truncation + to semantic type before classification. If we extend to long + double, we will also need to make double extern only. + (A normal long double value might become subnormal when + converted to double, and zero when converted to float.) +*/ +extern __inline__ int __fpclassify (double x){ + unsigned short sw; + __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); + return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); +} + +extern int __fpclassifyf (float); + +#define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) \ + : __fpclassify(x)) + +/* We don't need to worry about trucation here: + A NaN stays a NaN. */ + +extern __inline__ int __isnan (double _x) +{ + unsigned short sw; + __asm__ ("fxam;" + "fstsw %%ax": "=a" (sw) : "t" (_x)); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; +} + +extern __inline__ int __isnanf (float _x) +{ + unsigned short sw; + __asm__ ("fxam;" + "fstsw %%ax": "=a" (sw) : "t" (_x)); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; +} + +#define isnan(x) ((sizeof(x) == sizeof(float)) ? __isnanf(x) \ + : __isnan(x)) + + +#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0) +#define isinf(x) (fpclassify(x) == FP_INFINITE) +#define isnormal(x) (fpclassify(x) == FP_NORMAL) + + +extern __inline__ int __signbit (double x) { + unsigned short stw; + __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); + return stw & 0x0200; +} + +extern __inline__ int __signbitf (float x) { + unsigned short stw; + __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); + return stw & 0x0200; +} + +#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) \ + : __signbit(x)) +/* + * With these functions, comparisons involving quiet NaNs set the FP + * condition code to "unordered". The IEEE floating-point spec + * dictates that the result of floating-point comparisons should be + * false whenever a NaN is involved, with the exception of the !=, + * which always returns true. + */ + +#if __GNUC__ >= 3 + +#define isgreater(x, y) __builtin_isgreater(x, y) +#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) +#define isless(x, y) __builtin_isless(x, y) +#define islessequal(x, y) __builtin_islessequal(x, y) +#define islessgreater(x, y) __builtin_islessgreater(x, y) +#define isunordered(x, y) __builtin_isunordered(x, y) + +#else +/* helper */ +extern __inline__ int __fp_unordered_compare (double x, double y){ + unsigned short retval; + __asm__ ("fucom %%st(1);" + "fnstsw;": "=a" (retval) : "t" (x), "u" (y)); + return retval; +} + +#define isgreater(x, y) ((__fp_unordered_compare(x, y) \ + & 0x4500) == 0) +#define isless(x, y) ((__fp_unordered_compare (y, x) \ + & 0x4500) == 0) +#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \ + & FP_INFINITE) == 0) +#define islessequal(x, y) ((__fp_unordered_compare(y, x) \ + & FP_INFINITE) == 0) +#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \ + & FP_SUBNORMAL) == 0) +#define isunordered(x, y) ((__fp_unordered_compare(x, y) \ + & 0x4500) == 0x4500) + +#endif + +/* round, using fpu control word settings */ +extern __inline__ double rint (double x) +{ + double retval; + __asm__ ("frndint;": "=t" (retval) : "0" (x)); + return retval; +} + +extern __inline__ float rintf (float x) +{ + float retval; + __asm__ ("frndint;" : "=t" (retval) : "0" (x) ); + return retval; +} + +/* round away from zero, regardless of fpu control word settings */ +extern double round (double); +extern float roundf (float); + +/* round towards zero, regardless of fpu control word settings */ +extern double trunc (double); +extern float truncf (float); + + +/* fmax and fmin. + NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then the + these functions choose the numeric value. +*/ + +extern double fmax (double, double); +extern double fmin (double, double); +extern float fmaxf (float, float); +float fminf (float, float); + +/* return x * y + z as a ternary op */ +extern double fma (double, double, double); +extern float fmaf (float, float, float); + +/* one lonely transcendental */ +extern double log2 (double _x); +extern float log2f (float _x); + +/* The underscored versions are in MSVCRT.dll. + The stubs for these are in libmingwex.a */ + +double copysign (double, double); +float copysignf (float, float); +double logb (double); +float logbf (float); +double nextafter (double, double); +float nextafterf (float, float); +double scalb (double, long); +float scalbf (float, long); + +#if !defined (__STRICT_ANSI__) /* inline using non-ANSI functions */ +extern __inline__ double copysign (double x, double y) + { return _copysign(x, y); } +extern __inline__ float copysignf (float x, float y) + { return _copysign(x, y); } +extern __inline__ double logb (double x) + { return _logb(x); } +extern __inline__ float logbf (float x) + { return _logb(x); } +extern __inline__ double nextafter(double x, double y) + { return _nextafter(x, y); } +extern __inline__ float nextafterf(float x, float y) + { return _nextafter(x, y); } +extern __inline__ double scalb (double x, long i) + { return _scalb (x, i); } +extern __inline__ float scalbf (float x, long i) + { return _scalb(x, i); } +#endif /* (__STRICT_ANSI__) */ + +#ifdef __cplusplus +} +#endif #endif /* Not RC_INVOKED */ +#endif /* __NO_ISOCEXT */ + #endif /* Not _MATH_H_ */ diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h index 153e648..8774e40 100644 --- a/winsup/mingw/include/stdlib.h +++ b/winsup/mingw/include/stdlib.h @@ -285,12 +285,26 @@ int _wtoi (const wchar_t *); long _wtol (const wchar_t *); double strtod (const char*, char**); -double wcstod (const wchar_t*, wchar_t**); -long strtol (const char*, char**, int); -long wcstol (const wchar_t*, wchar_t**, int); +#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */ +extern __inline__ float strtof (const char *nptr, char **endptr) + { return (strtod (nptr, endptr));} +#endif /* __NO_ISOCEXT */ +long strtol (const char*, char**, int); unsigned long strtoul (const char*, char**, int); + +#ifndef _WSTDLIB_DEFINED +/* also declared in wchar.h */ +double wcstod (const wchar_t*, wchar_t**); +#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ +extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr) +{ return (wcstod(nptr, endptr)); } +#endif /* __NO_ISOCEXT */ + +long wcstol (const wchar_t*, wchar_t**, int); unsigned long wcstoul (const wchar_t*, wchar_t**, int); +#define _WSTDLIB_DEFINED +#endif size_t wcstombs (char*, const wchar_t*, size_t); int wctomb (char*, wchar_t); @@ -336,7 +350,6 @@ typedef struct { long quot, rem; } ldiv_t; div_t div (int, int); ldiv_t ldiv (long, long); - #ifndef __STRICT_ANSI__ /* @@ -348,6 +361,9 @@ void _seterrormode (int); void _sleep (unsigned long); void _exit (int) _ATTRIB_NORETURN; +/* C99 function name */ +static __inline__ void _Exit(int status) + { _exit(status); } /* _onexit is MS extension. Use atexit for portability. */ typedef int (* _onexit_t)(void); @@ -406,6 +422,49 @@ char* gcvt (double, int, char*); #endif /* Not __STRICT_ANSI__ */ +/* C99 names */ + +#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */ + +typedef struct { long long quot, rem; } lldiv_t; + +lldiv_t lldiv (long long, long long); + +extern __inline__ long long llabs(long long _j) + {return (_j >= 0 ? _j : -_j);} + +long long strtoll (const char* __restrict__, char** __restrict, int); +unsigned long long strtoull (const char* __restrict__, char** __restrict__, int); + +#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ +long long atoll (const char *); + +#if !defined (__STRICT_ANSI__) +long long wtoll(const wchar_t *); +char* lltoa(long long, char *, int); +char* ulltoa(unsigned long long , char *, int); +wchar_t* lltow(long long, wchar_t *, int); +wchar_t* ulltow(unsigned long long, wchar_t *, int); + + /* inline using non-ansi functions */ +extern __inline__ long long atoll (const char * _c) + { return _atoi64 (_c); } +extern __inline__ char* lltoa(long long _n, char * _c, int _i) + { return _i64toa (_n, _c, _i); } +extern __inline__ char* ulltoa(unsigned long long _n, char * _c, int _i) + { return _ui64toa (_n, _c, _i); } +extern __inline__ long long wtoll(const wchar_t * _w) + { return _wtoi64 (_w); } +extern __inline__ wchar_t* lltow(long long _n, wchar_t * _w, int _i) + { return _i64tow (_n, _w, _i); } +extern __inline__ wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i) + { return _ui64tow (_n, _w, _i); } +#endif /* (__STRICT_ANSI__) */ + +#endif /* __MSVCRT__ */ + +#endif /* !__NO_ISOCEXT */ + /* * Undefine the no return attribute used in some function definitions */ diff --git a/winsup/mingw/include/wchar.h b/winsup/mingw/include/wchar.h index eaeb4d0..c0eae52 100644 --- a/winsup/mingw/include/wchar.h +++ b/winsup/mingw/include/wchar.h @@ -234,6 +234,17 @@ wchar_t* _wsetlocale(int, const wchar_t*); #define _WLOCALE_DEFINED #endif +#ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */ +long wcstol (const wchar_t*, wchar_t**, int); +unsigned long wcstoul (const wchar_t*, wchar_t**, int); +double wcstod (const wchar_t*, wchar_t**); +#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ +extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr) +{ return (wcstod(nptr, endptr)); } +#endif /* __NO_ISOCEXT */ +#define _WSTDLIB_DEFINED +#endif + #ifndef _NO_OLDNAMES @@ -271,6 +282,23 @@ size_t wcrtomb(char *, wchar_t, mbstate_t *); size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *); int wctob(wint_t); +#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ +extern inline int fwide(FILE* stream, int mode) {return -1;} /* limited to byte orientation */ +extern inline int mbsinit(const mbstate_t* ps) {return 1;} +wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); +wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); +int wmemcmp(const wchar_t* s1, const wchar_t * s2, size_t n); +wchar_t* wmemcpy(wchar_t* __restrict__ s1, const wchar_t* __restrict__ s2, + size_t n); +wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); +long long wcstoll(const wchar_t* __restrict__ nptr, + wchar_t** __restrict__ endptr, int base); +unsigned long long wcstoull(const wchar_t* __restrict__ nptr, + wchar_t ** __restrict__ endptr, int base); + +#endif /* __NO_ISOCEXT */ + + #ifdef __cplusplus } /* end of extern "C" */ #endif |