cwchar.hpp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /*
  2. *
  3. * Copyright (c) 1998-2002
  4. * John Maddock
  5. *
  6. * Use, modification and distribution are subject to the
  7. * Boost Software License, Version 1.0. (See accompanying file
  8. * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. *
  10. */
  11. /*
  12. * LOCATION: see http://www.boost.org for most recent version.
  13. * FILE boost/regex/config/cwchar.hpp
  14. * VERSION see <boost/version.hpp>
  15. * DESCRIPTION: regex wide character string fixes.
  16. */
  17. #ifndef BOOST_REGEX_CONFIG_CWCHAR_HPP
  18. #define BOOST_REGEX_CONFIG_CWCHAR_HPP
  19. #include <cwchar>
  20. #include <cwctype>
  21. #include <boost/config.hpp>
  22. #if defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
  23. // apparently this is required for the RW STL on Linux:
  24. #undef iswalnum
  25. #undef iswalpha
  26. #undef iswblank
  27. #undef iswcntrl
  28. #undef iswdigit
  29. #undef iswgraph
  30. #undef iswlower
  31. #undef iswprint
  32. #undef iswprint
  33. #undef iswpunct
  34. #undef iswspace
  35. #undef iswupper
  36. #undef iswxdigit
  37. #undef iswctype
  38. #undef towlower
  39. #undef towupper
  40. #undef towctrans
  41. #undef wctrans
  42. #undef wctype
  43. #endif
  44. namespace std{
  45. #ifndef BOOST_NO_STDC_NAMESPACE
  46. extern "C"{
  47. #endif
  48. #ifdef iswalnum
  49. inline int (iswalnum)(wint_t i)
  50. { return iswalnum(i); }
  51. #undef iswalnum
  52. #elif defined(BOOST_NO_STDC_NAMESPACE)
  53. using ::iswalnum;
  54. #endif
  55. #ifdef iswalpha
  56. inline int (iswalpha)(wint_t i)
  57. { return iswalpha(i); }
  58. #undef iswalpha
  59. #elif defined(BOOST_NO_STDC_NAMESPACE)
  60. using ::iswalpha;
  61. #endif
  62. #ifdef iswcntrl
  63. inline int (iswcntrl)(wint_t i)
  64. { return iswcntrl(i); }
  65. #undef iswcntrl
  66. #elif defined(BOOST_NO_STDC_NAMESPACE)
  67. using ::iswcntrl;
  68. #endif
  69. #ifdef iswdigit
  70. inline int (iswdigit)(wint_t i)
  71. { return iswdigit(i); }
  72. #undef iswdigit
  73. #elif defined(BOOST_NO_STDC_NAMESPACE)
  74. using ::iswdigit;
  75. #endif
  76. #ifdef iswgraph
  77. inline int (iswgraph)(wint_t i)
  78. { return iswgraph(i); }
  79. #undef iswgraph
  80. #elif defined(BOOST_NO_STDC_NAMESPACE)
  81. using ::iswgraph;
  82. #endif
  83. #ifdef iswlower
  84. inline int (iswlower)(wint_t i)
  85. { return iswlower(i); }
  86. #undef iswlower
  87. #elif defined(BOOST_NO_STDC_NAMESPACE)
  88. using ::iswlower;
  89. #endif
  90. #ifdef iswprint
  91. inline int (iswprint)(wint_t i)
  92. { return iswprint(i); }
  93. #undef iswprint
  94. #elif defined(BOOST_NO_STDC_NAMESPACE)
  95. using ::iswprint;
  96. #endif
  97. #ifdef iswpunct
  98. inline int (iswpunct)(wint_t i)
  99. { return iswpunct(i); }
  100. #undef iswpunct
  101. #elif defined(BOOST_NO_STDC_NAMESPACE)
  102. using ::iswpunct;
  103. #endif
  104. #ifdef iswspace
  105. inline int (iswspace)(wint_t i)
  106. { return iswspace(i); }
  107. #undef iswspace
  108. #elif defined(BOOST_NO_STDC_NAMESPACE)
  109. using ::iswspace;
  110. #endif
  111. #ifdef iswupper
  112. inline int (iswupper)(wint_t i)
  113. { return iswupper(i); }
  114. #undef iswupper
  115. #elif defined(BOOST_NO_STDC_NAMESPACE)
  116. using ::iswupper;
  117. #endif
  118. #ifdef iswxdigit
  119. inline int (iswxdigit)(wint_t i)
  120. { return iswxdigit(i); }
  121. #undef iswxdigit
  122. #elif defined(BOOST_NO_STDC_NAMESPACE)
  123. using ::iswxdigit;
  124. #endif
  125. #ifdef towlower
  126. inline wint_t (towlower)(wint_t i)
  127. { return towlower(i); }
  128. #undef towlower
  129. #elif defined(BOOST_NO_STDC_NAMESPACE)
  130. using ::towlower;
  131. #endif
  132. #ifdef towupper
  133. inline wint_t (towupper)(wint_t i)
  134. { return towupper(i); }
  135. #undef towupper
  136. #elif defined(BOOST_NO_STDC_NAMESPACE)
  137. using :: towupper;
  138. #endif
  139. #ifdef wcscmp
  140. inline int (wcscmp)(const wchar_t *p1, const wchar_t *p2)
  141. { return wcscmp(p1,p2); }
  142. #undef wcscmp
  143. #elif defined(BOOST_NO_STDC_NAMESPACE)
  144. using ::wcscmp;
  145. #endif
  146. #ifdef wcscoll
  147. inline int (wcscoll)(const wchar_t *p1, const wchar_t *p2)
  148. { return wcscoll(p1,p2); }
  149. #undef wcscoll
  150. #elif defined(BOOST_NO_STDC_NAMESPACE) && !defined(UNDER_CE)
  151. using ::wcscoll;
  152. #endif
  153. #ifdef wcscpy
  154. inline wchar_t *(wcscpy)(wchar_t *p1, const wchar_t *p2)
  155. { return wcscpy(p1,p2); }
  156. #undef wcscpy
  157. #elif defined(BOOST_NO_STDC_NAMESPACE)
  158. using ::wcscpy;
  159. #endif
  160. #ifdef wcslen
  161. inline size_t (wcslen)(const wchar_t *p)
  162. { return wcslen(p); }
  163. #undef wcslen
  164. #elif defined(BOOST_NO_STDC_NAMESPACE)
  165. using ::wcslen;
  166. #endif
  167. #ifdef wcsxfrm
  168. size_t wcsxfrm(wchar_t *p1, const wchar_t *p2, size_t s)
  169. { return wcsxfrm(p1,p2,s); }
  170. #undef wcsxfrm
  171. #elif defined(BOOST_NO_STDC_NAMESPACE)
  172. using ::wcsxfrm;
  173. #endif
  174. #ifndef BOOST_NO_STDC_NAMESPACE
  175. } // extern "C"
  176. #endif
  177. } // namespace std
  178. #endif