From 915aad990b085a3f72d194b1f8738148b52f4cf7 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Mon, 7 Apr 2003 01:22:46 +0000 Subject: * include/_mingw.h: Don't include . (__MINGW_USE_NAMESPACES): Define as _GLIBCPP_USE_NAMESPACES. * include/ctype.h: Whitespace changes. * include/locale.h: Remove duplicate inclusion of . * include/stdlib.h: (strtof, strtold): Move out of std namespace. (wcstof, wcstold): Likewise. * include/time.h (strftime): Remove duplicate declaration. (_wasctime): Qualify tm with __CSTD. * include/wchar.h (wcstof, wcstold): Move out of std namespace. (wcstoll, wcstoull): Likewise. * include/sys/types.h (__MINGW_USE_NAMESPACES): Use instead of __USE_STD_CXX. --- winsup/mingw/ChangeLog | 15 +++++++++++++ winsup/mingw/include/_mingw.h | 14 ++++++------ winsup/mingw/include/ctype.h | 11 +++++----- winsup/mingw/include/locale.h | 6 +----- winsup/mingw/include/stdlib.h | 46 ++++++++++++++++++---------------------- winsup/mingw/include/sys/types.h | 2 +- winsup/mingw/include/time.h | 3 +-- winsup/mingw/include/wchar.h | 17 +++++++++------ 8 files changed, 60 insertions(+), 54 deletions(-) diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 1bf1ff40e56..7db5bb9e057 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,18 @@ +2003-04-07 Danny Smith + + * include/_mingw.h: Don't include . + (__MINGW_USE_NAMESPACES): Define as _GLIBCPP_USE_NAMESPACES. + * include/ctype.h: Whitespace changes. + * include/locale.h: Remove duplicate inclusion of . + * include/stdlib.h: (strtof, strtold): Move out of std namespace. + (wcstof, wcstold): Likewise. + * include/time.h (strftime): Remove duplicate declaration. + (_wasctime): Qualify tm with __CSTD. + * include/wchar.h (wcstof, wcstold): Move out of std namespace. + (wcstoll, wcstoull): Likewise. + * include/sys/types.h (__MINGW_USE_NAMESPACES): Use instead of + __USE_STD_CXX. + 2003-04-04 Danny Smith * include/_mingw.h:[__cplusplus] Include . diff --git a/winsup/mingw/include/_mingw.h b/winsup/mingw/include/_mingw.h index 86932ee6c38..a6f3f991c4e 100644 --- a/winsup/mingw/include/_mingw.h +++ b/winsup/mingw/include/_mingw.h @@ -87,16 +87,14 @@ #define __MINGW32_MINOR_VERSION 0 /* ISO C++. */ + #ifdef __cplusplus -#include -# ifndef __MINGW_USE_NAMESPACES -# if _GLIBCPP_USE_NAMESPACES -# define __MINGW_USE_NAMESPACES 1 -# else -# define __MINGW_USE_NAMESPACES 0 -# endif -# endif +#if defined _GLIBCPP_USE_NAMESPACES +# define __MINGW_USE_NAMESPACES _GLIBCPP_USE_NAMESPACES +#else +# define __MINGW_USE_NAMESPACES 0 +#endif # if !(defined(__BEGIN_CSTD_NAMESPACE) \ && defined(__END_CSTD_NAMESPACE)) diff --git a/winsup/mingw/include/ctype.h b/winsup/mingw/include/ctype.h index 8828ba13c63..0b908051b21 100644 --- a/winsup/mingw/include/ctype.h +++ b/winsup/mingw/include/ctype.h @@ -136,7 +136,7 @@ __MINGW_IMPORT unsigned short _ctype[]; # define _pctype _pctype_dll # endif -#else /* __DECLSPEC_SUPPORTED */ +#else /* __DECLSPEC_SUPPORTED */ extern unsigned short** _imp___ctype; #define _ctype (*_imp___ctype) # ifdef __MSVCRT__ @@ -162,8 +162,8 @@ extern unsigned short** _imp___ctype; * optimise away the constant condition. */ -#if ! (defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES) \ - || defined (__STRICT_ANSI__ )) +#if !(defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES) \ + || defined (__STRICT_ANSI__)) /* use simple lookup if SB locale, else _isctype() */ #define __ISCTYPE(__c, __mask) \ (MB_CUR_MAX == 1 ? (_pctype[__c] & __mask) : __CGLOBAL _isctype(__c, __mask)) @@ -181,7 +181,6 @@ extern __inline__ int __cdecl isxdigit(int __c) {return __ISCTYPE(__c, _HEX);} /* TODO? Is it worth inlining ANSI tolower, toupper? Probably only if we only want C-locale. */ - #endif /* _NO_CTYPE_INLINES */ /* Wide character equivalents @@ -215,7 +214,7 @@ _CRTIMP wchar_t __cdecl towupper(wchar_t); _CRTIMP int __cdecl isleadbyte (int); -#if ! (defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) +#if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) #define __WCTYPE_INLINES_DEFINED extern __inline__ int __cdecl iswalnum(wint_t __wc) {return (iswctype(__wc,_ALPHA|_DIGIT));} extern __inline__ int __cdecl iswalpha(wint_t __wc) {return (iswctype(__wc,_ALPHA));} @@ -241,7 +240,7 @@ __BEGIN_CGLOBAL_NAMESPACE _CRTIMP int __cdecl __isascii (int); _CRTIMP int __cdecl __toascii (int); _CRTIMP int __cdecl __iscsymf (int); /* Valid first character in C symbol */ -_CRTIMP int __cdecl __iscsym (int); /* Valid character in C symbol (after first) */ +_CRTIMP int __cdecl __iscsym (int); /* Valid character in C symbol (after first) */ #ifndef __NO_CTYPE_INLINES extern __inline__ int __cdecl __isascii(int __c) {return ((__c & ~0x7F) == 0);} diff --git a/winsup/mingw/include/locale.h b/winsup/mingw/include/locale.h index cfbf9c2bff8..75ecf3bc64f 100644 --- a/winsup/mingw/include/locale.h +++ b/winsup/mingw/include/locale.h @@ -51,16 +51,12 @@ #ifndef RC_INVOKED -/* According to C89 std, NULL is defined in locale.h too */ +/* According to C89 std, NULL is defined in locale.h too. */ #define __need_NULL #include __BEGIN_CSTD_NAMESPACE -/* According to C89 std, NULL is defined in locale.h too. */ -#define __need_NULL -#include - /* * The structure returned by 'localeconv'. */ diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h index 51279ae75b3..4dd09421cc7 100644 --- a/winsup/mingw/include/stdlib.h +++ b/winsup/mingw/include/stdlib.h @@ -30,7 +30,6 @@ /* All the headers include this file. */ #include <_mingw.h> - #define __need_size_t #define __need_wchar_t #define __need_NULL @@ -70,7 +69,6 @@ #endif /* Not __STRICT_ANSI__ */ - #ifndef RC_INVOKED __BEGIN_CGLOBAL_NAMESPACE @@ -327,38 +325,35 @@ _CRTIMP int __cdecl atoi (const char*); _CRTIMP long __cdecl atol (const char*); _CRTIMP double __cdecl strtod (const char*, char**); -#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */ -extern __inline__ float __cdecl strtof (const char *__nptr, char **__endptr) - { return (strtod (__nptr, __endptr));} -long double __cdecl strtold (const char * __restrict__, char ** __restrict__); -#endif /* __NO_ISOCEXT */ - _CRTIMP long __cdecl strtol (const char*, char**, int); _CRTIMP unsigned long __cdecl strtoul (const char*, char**, int); - __END_CSTD_NAMESPACE -__BEGIN_CGLOBAL_NAMESPACE - -_CRTIMP int __cdecl _wtoi (const wchar_t *); -_CRTIMP long __cdecl _wtol (const wchar_t *); +#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */ +__BEGIN_CGLOBAL_NAMESPACE /* C99 */ +extern __inline__ float __cdecl strtof (const char *__nptr, char **__endptr) + { return (__CSTD strtod (__nptr, __endptr));} +long double __cdecl strtold (const char * __restrict__, char ** __restrict__); __END_CGLOBAL_NAMESPACE -__BEGIN_CSTD_NAMESPACE +#endif /* __NO_ISOCEXT */ -#ifndef _WSTDLIB_DEFINED -/* also declared in wchar.h */ +#ifndef _WSTDLIB_DEFINED /* also declared in wchar.h */ +__BEGIN_CSTD_NAMESPACE +_CRTIMP long __cdecl wcstol (const wchar_t*, wchar_t**, int); +_CRTIMP unsigned long __cdecl wcstoul (const wchar_t*, wchar_t**, int); _CRTIMP double __cdecl wcstod (const wchar_t*, wchar_t**); +__END_CSTD_NAMESPACE #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ -extern __inline__ float __cdecl wcstof (const wchar_t *__nptr, wchar_t **__endptr) -{ return (wcstod(__nptr, __endptr)); } +__BEGIN_CGLOBAL_NAMESPACE /* C99 */ +extern __inline__ float __cdecl wcstof( const wchar_t *__nptr, wchar_t **__endptr) + { return __CSTD wcstod(__nptr, __endptr); } long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); +__END_CGLOBAL_NAMESPACE #endif /* __NO_ISOCEXT */ - -_CRTIMP long __cdecl wcstol (const wchar_t*, wchar_t**, int); -_CRTIMP unsigned long __cdecl wcstoul (const wchar_t*, wchar_t**, int); -#define _WSTDLIB_DEFINED +#define _WSTDLIB_DEFINED #endif +__BEGIN_CSTD_NAMESPACE _CRTIMP size_t __cdecl wcstombs (char*, const wchar_t*, size_t); _CRTIMP int __cdecl wctomb (char*, wchar_t); @@ -441,6 +436,9 @@ wchar_t* _itow (int, wchar_t*, int); _CRTIMP wchar_t* __cdecl _ltow (long, wchar_t*, int); _CRTIMP wchar_t* __cdecl _ultow (unsigned long, wchar_t*, int); +_CRTIMP int __cdecl _wtoi (const wchar_t *); +_CRTIMP long __cdecl _wtol (const wchar_t *); + #ifdef __MSVCRT__ __int64 _atoi64(const char *); _CRTIMP char* __cdecl _i64toa(__int64, char *, int); @@ -479,11 +477,9 @@ _CRTIMP char* __cdecl gcvt (double, int, char*); #endif /* Not __STRICT_ANSI__ */ -/* C99 names */ +/* C99 */ /* NOTE: These are in global namespace for now. */ - #if !defined __NO_ISOCEXT /* externs in static libmingwex.a */ - void __cdecl _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */ #ifndef __STRICT_ANSI__ /* inline using non-ANSI exit */ extern __inline__ void _Exit(int __status) diff --git a/winsup/mingw/include/sys/types.h b/winsup/mingw/include/sys/types.h index 66b7eaca679..5e6d9822077 100644 --- a/winsup/mingw/include/sys/types.h +++ b/winsup/mingw/include/sys/types.h @@ -49,7 +49,7 @@ __END_CSTD_NAMESPACE #endif /* If we include this non-std header, we inject time_t into global */ -#if defined (__cplusplus) && (__HAVE_STD_CXX) +#if defined (__cplusplus) && (__MINGW_USE_NAMESPACES) using __CSTD time_t; #endif diff --git a/winsup/mingw/include/time.h b/winsup/mingw/include/time.h index 581f9229669..43b024b9055 100644 --- a/winsup/mingw/include/time.h +++ b/winsup/mingw/include/time.h @@ -122,7 +122,6 @@ extern _CRTIMP void __cdecl _tzset (void); extern _CRTIMP void __cdecl tzset (void); #endif -_CRTIMP size_t __cdecl strftime(char*, size_t, const char*, const struct tm*); _CRTIMP char* __cdecl _strdate(char*); _CRTIMP char* __cdecl _strtime(char*); @@ -182,7 +181,7 @@ __MINGW_IMPORT char *tzname[2]; /* wide function prototypes, also declared in wchar.h */ -_CRTIMP wchar_t* __cdecl _wasctime(const struct tm*); +_CRTIMP wchar_t* __cdecl _wasctime(const struct __CSTD tm*); _CRTIMP wchar_t* __cdecl _wctime(const __CSTD time_t*); _CRTIMP wchar_t* __cdecl _wstrdate(wchar_t*); _CRTIMP wchar_t* __cdecl _wstrtime(wchar_t*); diff --git a/winsup/mingw/include/wchar.h b/winsup/mingw/include/wchar.h index a045753a457..b25a251e13b 100644 --- a/winsup/mingw/include/wchar.h +++ b/winsup/mingw/include/wchar.h @@ -148,7 +148,7 @@ _CRTIMP __CSTD FILE* __cdecl _wpopen (const wchar_t*, const wchar_t*); int __cdecl _snwprintf (wchar_t*, __CSTD size_t, const wchar_t*, ...); int __cdecl _vsnwprintf (wchar_t*, __CSTD size_t, const wchar_t*, __VALIST); #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -int __cdecl snwprintf(wchar_t* s, __CSTD size_t n, const wchar_t* format, ...); +int __cdecl snwprintf (wchar_t* s, __CSTD size_t n, const wchar_t* format, ...); extern __inline__ int __cdecl vsnwprintf (wchar_t* __s, __CSTD size_t __n, const wchar_t* __format, __VALIST __arg) @@ -409,12 +409,14 @@ __BEGIN_CSTD_NAMESPACE _CRTIMP long __cdecl wcstol (const wchar_t*, wchar_t**, int); _CRTIMP unsigned long __cdecl wcstoul (const wchar_t*, wchar_t**, int); _CRTIMP double __cdecl wcstod (const wchar_t*, wchar_t**); +__END_CSTD_NAMESPACE #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ +__BEGIN_CGLOBAL_NAMESPACE extern __inline__ float __cdecl wcstof( const wchar_t *__nptr, wchar_t **__endptr) - { return (wcstod(__nptr, __endptr)); } + { return __CSTD wcstod(__nptr, __endptr); } long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); +__END_CGLOBAL_NAMESPACE #endif /* __NO_ISOCEXT */ -__END_CSTD_NAMESPACE #define _WSTDLIB_DEFINED #endif @@ -423,7 +425,6 @@ typedef wchar_t _Wint_t; /* Used only by MSVC C++ headers? */ #endif __BEGIN_CSTD_NAMESPACE - typedef int mbstate_t; /* These are resolved by -lmsvcp60 */ @@ -438,8 +439,10 @@ size_t __cdecl mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); size_t __cdecl wcrtomb(char *, wchar_t, mbstate_t *); size_t __cdecl wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *); int __cdecl wctob(wint_t); +__END_CSTD_NAMESPACE #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ +__BEGIN_CSTD_NAMESPACE extern __inline__ int fwide(FILE* __stream, int __mode) {return -1;} /* limited to byte orientation */ extern __inline__ int mbsinit(const mbstate_t* __ps) @@ -450,15 +453,15 @@ int __cdecl wmemcmp(const wchar_t* s1, const wchar_t * s2, size_t n); wchar_t* __cdecl wmemcpy(wchar_t* __restrict__ s1, const wchar_t* __restrict__ s2, size_t n); wchar_t* __cdecl wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); +__END_CSTD_NAMESPACE +__BEGIN_CGLOBAL_NAMESPACE long long __cdecl wcstoll(const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, int base); unsigned long long __cdecl wcstoull(const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base); - +__END_CGLOBAL_NAMESPACE #endif /* __NO_ISOCEXT */ -__END_CSTD_NAMESPACE - #endif /* Not RC_INVOKED */ #endif /* not _WCHAR_H_ */ -- cgit v1.2.1