ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_cwchar.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999
00003  * Boris Fomitchev
00004  *
00005  * This material is provided "as is", with absolutely no warranty expressed
00006  * or implied. Any use is at your own risk.
00007  *
00008  * Permission to use or copy this software for any purpose is hereby granted
00009  * without fee, provided the above notices are retained on all copies.
00010  * Permission to modify the code and to distribute modified code is granted,
00011  * provided the above notices are retained, and a notice that the code was
00012  * modified is included with the above copyright notice.
00013  *
00014  */
00015 
00016 #ifndef _STLP_INTERNAL_CWCHAR
00017 #define _STLP_INTERNAL_CWCHAR
00018 
00019 #if defined (_STLP_WCE_EVC3)
00020 #  ifndef _STLP_INTERNAL_MBSTATE_T
00021 #    include <stl/_mbstate_t.h>
00022 #  endif
00023 #else
00024 #  if defined (__GNUC__)
00025 #    if defined (_STLP_HAS_INCLUDE_NEXT)
00026 #      include_next <cstddef>
00027 #    else
00028 #      include _STLP_NATIVE_CPP_C_HEADER(cstddef)
00029 #    endif
00030 #  endif
00031 
00032 #  if !defined (_STLP_NO_CWCHAR) && defined (_STLP_USE_NEW_C_HEADERS)
00033 #    if defined (_STLP_HAS_INCLUDE_NEXT)
00034 #      include_next <cwchar>
00035 #    else
00036 #      include _STLP_NATIVE_CPP_C_HEADER(cwchar)
00037 #    endif
00038 #    if defined (__OpenBSD__)
00039 typedef _BSD_WINT_T_ wint_t;
00040 #    endif /* __OpenBSD__ */
00041 
00042 #    if defined (__DMC__)
00043 #      define __STDC_LIMIT_MACROS
00044 #      include <stdint.h> // WCHAR_MIN, WCHAR_MAX
00045 #    endif
00046 #  elif defined (_STLP_NO_WCHAR_T) || \
00047        (defined (__BORLANDC__) && (__BORLANDC__ < 0x570)) || \
00048         defined (__OpenBSD__) || defined (__FreeBSD__) || \
00049        (defined (__GNUC__) && (defined (__APPLE__) || defined ( __Lynx__ )))
00050 #    if defined (_STLP_HAS_INCLUDE_NEXT)
00051 #      include_next <stddef.h>
00052 #    else
00053 #      include _STLP_NATIVE_C_HEADER(stddef.h)
00054 #    endif
00055 #    if defined (__Lynx__)
00056 #      ifndef _WINT_T
00057 typedef long int wint_t;
00058 #        define _WINT_T
00059 #      endif /* _WINT_T */
00060 #    endif
00061 #    if defined(__OpenBSD__)
00062 typedef _BSD_WINT_T_ wint_t;
00063 #    endif /* __OpenBSD__ */
00064 #  else
00065 #    if defined (_STLP_HAS_INCLUDE_NEXT)
00066 #      include_next <wchar.h>
00067 #    else
00068 #      include _STLP_NATIVE_C_HEADER(wchar.h)
00069 #    endif
00070 
00071 #    if defined (__sun) && (defined (_XOPEN_SOURCE) || (_XOPEN_VERSION - 0 == 4))
00072 extern wint_t   btowc();
00073 extern int      fwprintf();
00074 extern int      fwscanf();
00075 extern int      fwide();
00076 extern int      mbsinit();
00077 extern size_t   mbrlen();
00078 extern size_t   mbrtowc();
00079 extern size_t   mbsrtowcs();
00080 extern int      swprintf();
00081 extern int      swscanf();
00082 extern int      vfwprintf();
00083 extern int      vwprintf();
00084 extern int      vswprintf();
00085 extern size_t   wcrtomb();
00086 extern size_t   wcsrtombs();
00087 extern wchar_t  *wcsstr();
00088 extern int      wctob();
00089 extern wchar_t  *wmemchr();
00090 extern int      wmemcmp();
00091 extern wchar_t  *wmemcpy();
00092 extern wchar_t  *wmemmove();
00093 extern wchar_t  *wmemset();
00094 extern int      wprintf();
00095 extern int      wscanf();
00096 #    endif
00097 #  endif
00098 
00099 #  if defined (__MSL__) && (__MSL__ <= 0x51FF)  /* dwa 2/28/99 - not yet implemented by MSL  */
00100 #    define _STLP_WCHAR_MSL_EXCLUDE 1
00101 namespace std {
00102   extern "C" size_t wcsftime(wchar_t * str, size_t max_size, const wchar_t * format_str, const struct tm * timeptr);
00103 }
00104 #    define _STLP_NO_NATIVE_MBSTATE_T 1
00105 #  elif defined (__BORLANDC__)
00106 #    if !defined (_STLP_USE_NO_IOSTREAMS)
00107 #      define _STLP_NO_NATIVE_MBSTATE_T
00108 #    endif
00109 #    define _STLP_WCHAR_BORLAND_EXCLUDE 1
00110 #  endif
00111 
00112 #  ifndef _STLP_INTERNAL_MBSTATE_T
00113 #    include <stl/_mbstate_t.h>
00114 #  endif
00115 
00116 #  if !defined (_STLP_NO_WCHAR_T)
00117 #    ifndef WCHAR_MIN
00118 #      define WCHAR_MIN 0
00119 /* SUNpro has some bugs with casts. wchar_t is size of int there anyway. */
00120 #      if defined (__SUNPRO_CC) || defined (__DJGPP)
00121 #        define WCHAR_MAX (~0)
00122 #      else
00123 #        define WCHAR_MAX ((wchar_t)~0)
00124 #      endif
00125 #    endif
00126 #    if defined (__DMC__) || (defined (_STLP_MSVC_LIB) && (_STLP_MSVC_LIB < 1400)) || defined(_WIN32_WCE)
00127 /* Compilers that do not define WCHAR_MIN and WCHAR_MAX to be testable at
00128  * preprocessing time. */
00129 #      undef WCHAR_MIN
00130 #      define WCHAR_MIN 0
00131 #      undef WCHAR_MAX
00132 #      define WCHAR_MAX 0xffff
00133 #    endif
00134 #    if defined (__GNUC__) && defined (__alpha__)
00135 /* Definition of WCHAR_MIN and MAX are wrong for alpha platform
00136  * as gcc consider wchar_t as an unsigned type but WCHAR_MIN is defined as
00137  * a negative value. Static assertion is here to check that a future alpha
00138  * SDK or a future gcc won't change the situation making this workaround
00139  * useless.
00140  */
00141 /* Check that gcc still consider wchar_t as unsigned */
00142 _STLP_STATIC_ASSERT(((wchar_t)-1 > 0))
00143 /* Check that WCHAR_MIN value hasn't been fixed */
00144 _STLP_STATIC_ASSERT((WCHAR_MIN < 0))
00145 #      undef WCHAR_MIN
00146 #      define WCHAR_MIN 0
00147 #      undef WCHAR_MAX
00148 #      define WCHAR_MAX 0xffffffff
00149 #    endif
00150 #    if defined(__HP_aCC) && (__HP_aCC >= 60000)
00151 /* Starting with B.11.31, HP-UX/ia64 provides C99-compliant definitions
00152  * of WCHAR_MIN/MAX macros without having to define
00153  * _INCLUDE_STDC__SOURCE_199901 macro (which aCC compiler does not
00154  * predefine). Let STLport provide B.11.31 definitions on any version of
00155  * HP-UX/ia64.
00156  */
00157 #      undef WCHAR_MIN
00158 #      define WCHAR_MIN 0
00159 #      undef WCHAR_MAX
00160 #      define WCHAR_MAX UINT_MAX
00161 #    endif
00162 #  endif
00163 
00164 #  if defined (_STLP_IMPORT_VENDOR_CSTD)
00165 
00166 #    if defined (__SUNPRO_CC) && !defined (_STLP_HAS_NO_NEW_C_HEADERS)
00167 using _STLP_VENDOR_CSTD::wint_t;
00168 #    endif
00169 
00170 _STLP_BEGIN_NAMESPACE
00171 #    if defined (_STLP_NO_WCHAR_T)
00172 typedef int wint_t;
00173 #    else
00174 // gcc 3.0 has a glitch : wint_t only sucked into the global namespace if _GLIBCPP_USE_WCHAR_T is defined
00175 // __MWERKS__ has definition in wchar_t.h (MSL C++), but ones differ from definition
00176 // in stdio.h; I prefer settings from last file.
00177 #      if (defined (__GNUC__) && ! defined (_GLIBCPP_USE_WCHAR_T))
00178 using ::wint_t;
00179 #      else
00180 using _STLP_VENDOR_CSTD::wint_t;
00181 #      endif
00182 #    endif
00183 
00184 using _STLP_VENDOR_CSTD::size_t;
00185 
00186 #    if !defined (_STLP_NO_NATIVE_MBSTATE_T) && !defined (_STLP_USE_OWN_MBSTATE_T)
00187 using _STLP_VENDOR_MB_NAMESPACE::mbstate_t;
00188 
00189 #      if !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS) && !defined(_STLP_WCHAR_BORLAND_EXCLUDE) && \
00190          (!defined(__MSL__) || __MSL__ > 0x6001)
00191 #        if defined (__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 8))) || \
00192           !(defined (__KCC) || defined (__GNUC__)) && !defined(_STLP_WCE_NET)
00193 using _STLP_VENDOR_MB_NAMESPACE::btowc;
00194 #          if (!defined(__MSL__) || __MSL__ > 0x7001)
00195 using _STLP_VENDOR_MB_NAMESPACE::mbsinit;
00196 #          endif
00197 #        endif
00198 #        if defined (__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 8))) || \
00199            !defined (__GNUC__) && !defined(_STLP_WCE_NET)
00200 using _STLP_VENDOR_MB_NAMESPACE::mbrlen;
00201 using _STLP_VENDOR_MB_NAMESPACE::mbrtowc;
00202 using _STLP_VENDOR_MB_NAMESPACE::mbsrtowcs;
00203 using _STLP_VENDOR_MB_NAMESPACE::wcrtomb;
00204 using _STLP_VENDOR_MB_NAMESPACE::wcsrtombs;
00205 #        endif
00206 #      endif /* BORLAND && !__MSL__ || __MSL__ > 0x6001 */
00207 
00208 #    endif /* _STLP_NO_NATIVE_MBSTATE_T */
00209 
00210 #    if !defined (_STLP_NO_NATIVE_WIDE_FUNCTIONS) && ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
00211 
00212 #      if !defined (_STLP_WCHAR_BORLAND_EXCLUDE) && ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
00213 using _STLP_VENDOR_CSTD::fgetwc;
00214 using _STLP_VENDOR_CSTD::fgetws;
00215 using _STLP_VENDOR_CSTD::fputwc;
00216 using _STLP_VENDOR_CSTD::fputws;
00217 #      endif
00218 
00219 #      if !(defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_BORLAND_EXCLUDE) || \
00220             defined(_STLP_WCHAR_HPACC_EXCLUDE) )
00221 #        if !defined (__DECCXX)
00222 using _STLP_VENDOR_CSTD::fwide;
00223 #        endif
00224 using _STLP_VENDOR_CSTD::fwprintf;
00225 using _STLP_VENDOR_CSTD::fwscanf;
00226 using _STLP_VENDOR_CSTD::getwchar;
00227 #      endif
00228 
00229 #      if !defined(_STLP_WCHAR_BORLAND_EXCLUDE)
00230 #        ifndef _STLP_WCE_NET
00231 using _STLP_VENDOR_CSTD::getwc;
00232 #        endif
00233 using _STLP_VENDOR_CSTD::ungetwc;
00234 #        ifndef _STLP_WCE_NET
00235 using _STLP_VENDOR_CSTD::putwc;
00236 #        endif
00237 using _STLP_VENDOR_CSTD::putwchar;
00238 #      endif
00239 
00240 #      if !(defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_BORLAND_EXCLUDE) || \
00241             defined (_STLP_WCHAR_HPACC_EXCLUDE) )
00242 #        if defined (_STLP_MSVC_LIB) && (_STLP_MSVC_LIB <= 1300) || \
00243             defined (__MINGW32__)
00244 #          undef swprintf
00245 #          define swprintf _snwprintf
00246 #          undef vswprintf
00247 #          define vswprintf _vsnwprintf
00248 using ::swprintf;
00249 using ::vswprintf;
00250 #        else
00251 using _STLP_VENDOR_CSTD::swprintf;
00252 using _STLP_VENDOR_CSTD::vswprintf;
00253 #        endif
00254 using _STLP_VENDOR_CSTD::swscanf;
00255 using _STLP_VENDOR_CSTD::vfwprintf;
00256 using _STLP_VENDOR_CSTD::vwprintf;
00257 
00258 #        if (!defined(__MSL__) || __MSL__ > 0x7001 ) && !defined(_STLP_WCE_NET) && \
00259              !defined(_STLP_USE_UCLIBC) /* at least in uClibc 0.9.26 */
00260 
00261 using _STLP_VENDOR_CSTD::wcsftime;
00262 #        endif
00263 using _STLP_VENDOR_CSTD::wcstok;
00264 
00265 #      endif
00266 
00267 #      if !defined (_STLP_WCE_NET)
00268 using _STLP_VENDOR_CSTD::wcscoll;
00269 using _STLP_VENDOR_CSTD::wcsxfrm;
00270 #      endif
00271 using _STLP_VENDOR_CSTD::wcscat;
00272 using _STLP_VENDOR_CSTD::wcsrchr;
00273 using _STLP_VENDOR_CSTD::wcscmp;
00274 
00275 using _STLP_VENDOR_CSTD::wcscpy;
00276 using _STLP_VENDOR_CSTD::wcscspn;
00277 
00278 using _STLP_VENDOR_CSTD::wcslen;
00279 using _STLP_VENDOR_CSTD::wcsncat;
00280 using _STLP_VENDOR_CSTD::wcsncmp;
00281 using _STLP_VENDOR_CSTD::wcsncpy;
00282 using _STLP_VENDOR_CSTD::wcspbrk;
00283 using _STLP_VENDOR_CSTD::wcschr;
00284 
00285 using _STLP_VENDOR_CSTD::wcsspn;
00286 
00287 #      if !defined (_STLP_WCHAR_BORLAND_EXCLUDE)
00288 using _STLP_VENDOR_CSTD::wcstod;
00289 using _STLP_VENDOR_CSTD::wcstol;
00290 #      endif
00291 
00292 #      if !(defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_HPACC_EXCLUDE) )
00293 using _STLP_VENDOR_CSTD::wcsstr;
00294 using _STLP_VENDOR_CSTD::wmemchr;
00295 
00296 #        if !defined (_STLP_WCHAR_BORLAND_EXCLUDE)
00297 #            if !defined (_STLP_WCE_NET)
00298 using _STLP_VENDOR_CSTD::wctob;
00299 #            endif
00300 #          if !defined (__DMC__)
00301 using _STLP_VENDOR_CSTD::wmemcmp;
00302 using _STLP_VENDOR_CSTD::wmemmove;
00303 #          endif
00304 using _STLP_VENDOR_CSTD::wprintf;
00305 using _STLP_VENDOR_CSTD::wscanf;
00306 #        endif
00307 
00308 #        if defined (__BORLANDC__) && !defined (__linux__)
00309 inline wchar_t* _STLP_wmemcpy(wchar_t* __wdst, const wchar_t* __wsrc, size_t __n)
00310 { return __STATIC_CAST(wchar_t*, _STLP_VENDOR_CSTD::wmemcpy(__wdst, __wsrc, __n)); }
00311 inline wchar_t* _STLP_wmemset(wchar_t* __wdst, wchar_t __wc, size_t __n)
00312 { return __STATIC_CAST(wchar_t*, _STLP_VENDOR_CSTD::memset(__wdst, __wc, __n)); }
00313 #          undef wmemcpy
00314 #          undef wmemset
00315 inline wchar_t* wmemcpy(wchar_t* __wdst, const wchar_t* __wsrc, size_t __n)
00316 { return _STLP_wmemcpy(__wdst, __wsrc, __n); }
00317 inline wchar_t* wmemset(wchar_t* __wdst, wchar_t __wc, size_t __n)
00318 { return _STLP_wmemset(__wdst, __wc, __n); }
00319 #        elif defined (__DMC__)
00320 inline wchar_t* wmemcpy(wchar_t* __RESTRICT __wdst, const wchar_t* __RESTRICT __wsrc, size_t __n)
00321 { return __STATIC_CAST(wchar_t*, memcpy(__wdst, __wsrc, __n * sizeof(wchar_t))); }
00322 inline wchar_t* wmemmove(wchar_t* __RESTRICT __wdst, const wchar_t * __RESTRICT __wc, size_t __n)
00323 { return __STATIC_CAST(wchar_t*, memmove(__wdst, __wc, __n * sizeof(wchar_t))); }
00324 inline wchar_t* wmemset(wchar_t* __wdst, wchar_t __wc, size_t __n)
00325 { for (size_t i = 0; i < __n; i++) __wdst[i] = __wc; return __wdst; }
00326 #        else
00327 using _STLP_VENDOR_CSTD::wmemcpy;
00328 using _STLP_VENDOR_CSTD::wmemset;
00329 #        endif
00330 #      endif
00331 
00332 #    endif /* _STLP_NO_NATIVE_WIDE_FUNCTIONS */
00333 _STLP_END_NAMESPACE
00334 
00335 #  endif /* _STLP_IMPORT_VENDOR_CSTD */
00336 
00337 #  undef _STLP_WCHAR_SUNPRO_EXCLUDE
00338 #  undef _STLP_WCHAR_MSL_EXCLUDE
00339 
00340 #  endif /* !defined(_STLP_WCE_EVC3) */
00341 
00342 #endif /* _STLP_INTERNAL_CWCHAR */

Generated on Mon May 28 2012 04:28:46 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.