Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

307 Zeilen
6.4KB

  1. // -*- C++ -*- forwarding header.
  2. // Copyright (C) 1997-2020 Free Software Foundation, Inc.
  3. //
  4. // This file is part of the GNU ISO C++ Library. This library is free
  5. // software; you can redistribute it and/or modify it under the
  6. // terms of the GNU General Public License as published by the
  7. // Free Software Foundation; either version 3, or (at your option)
  8. // any later version.
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // Under Section 7 of GPL version 3, you are granted additional
  14. // permissions described in the GCC Runtime Library Exception, version
  15. // 3.1, as published by the Free Software Foundation.
  16. // You should have received a copy of the GNU General Public License and
  17. // a copy of the GCC Runtime Library Exception along with this program;
  18. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. // <http://www.gnu.org/licenses/>.
  20. /** @file include/cwchar
  21. * This is a Standard C++ Library file. You should @c \#include this file
  22. * in your programs, rather than any of the @a *.h implementation files.
  23. *
  24. * This is the C++ version of the Standard C Library header @c wchar.h,
  25. * and its contents are (mostly) the same as that header, but are all
  26. * contained in the namespace @c std (except for names which are defined
  27. * as macros in C).
  28. */
  29. //
  30. // ISO C++ 14882: 21.4
  31. //
  32. #pragma GCC system_header
  33. #include <bits/c++config.h>
  34. #if _GLIBCXX_HAVE_WCHAR_H
  35. #include <wchar.h>
  36. #endif
  37. #ifndef _GLIBCXX_CWCHAR
  38. #define _GLIBCXX_CWCHAR 1
  39. // Need to do a bit of trickery here with mbstate_t as char_traits
  40. // assumes it is in wchar.h, regardless of wchar_t specializations.
  41. #ifndef _GLIBCXX_HAVE_MBSTATE_T
  42. extern "C"
  43. {
  44. typedef struct
  45. {
  46. int __fill[6];
  47. } mbstate_t;
  48. }
  49. #endif
  50. namespace std
  51. {
  52. using ::mbstate_t;
  53. } // namespace std
  54. // Get rid of those macros defined in <wchar.h> in lieu of real functions.
  55. #undef btowc
  56. #undef fgetwc
  57. #undef fgetws
  58. #undef fputwc
  59. #undef fputws
  60. #undef fwide
  61. #undef fwprintf
  62. #undef fwscanf
  63. #undef getwc
  64. #undef getwchar
  65. #undef mbrlen
  66. #undef mbrtowc
  67. #undef mbsinit
  68. #undef mbsrtowcs
  69. #undef putwc
  70. #undef putwchar
  71. #undef swprintf
  72. #undef swscanf
  73. #undef ungetwc
  74. #undef vfwprintf
  75. #if _GLIBCXX_HAVE_VFWSCANF
  76. # undef vfwscanf
  77. #endif
  78. #undef vswprintf
  79. #if _GLIBCXX_HAVE_VSWSCANF
  80. # undef vswscanf
  81. #endif
  82. #undef vwprintf
  83. #if _GLIBCXX_HAVE_VWSCANF
  84. # undef vwscanf
  85. #endif
  86. #undef wcrtomb
  87. #undef wcscat
  88. #undef wcschr
  89. #undef wcscmp
  90. #undef wcscoll
  91. #undef wcscpy
  92. #undef wcscspn
  93. #undef wcsftime
  94. #undef wcslen
  95. #undef wcsncat
  96. #undef wcsncmp
  97. #undef wcsncpy
  98. #undef wcspbrk
  99. #undef wcsrchr
  100. #undef wcsrtombs
  101. #undef wcsspn
  102. #undef wcsstr
  103. #undef wcstod
  104. #if _GLIBCXX_HAVE_WCSTOF
  105. # undef wcstof
  106. #endif
  107. #undef wcstok
  108. #undef wcstol
  109. #undef wcstoul
  110. #undef wcsxfrm
  111. #undef wctob
  112. #undef wmemchr
  113. #undef wmemcmp
  114. #undef wmemcpy
  115. #undef wmemmove
  116. #undef wmemset
  117. #undef wprintf
  118. #undef wscanf
  119. #if _GLIBCXX_USE_WCHAR_T
  120. extern "C++"
  121. {
  122. namespace std _GLIBCXX_VISIBILITY(default)
  123. {
  124. _GLIBCXX_BEGIN_NAMESPACE_VERSION
  125. using ::wint_t;
  126. using ::btowc;
  127. using ::fgetwc;
  128. using ::fgetws;
  129. using ::fputwc;
  130. using ::fputws;
  131. using ::fwide;
  132. using ::fwprintf;
  133. using ::fwscanf;
  134. using ::getwc;
  135. using ::getwchar;
  136. using ::mbrlen;
  137. using ::mbrtowc;
  138. using ::mbsinit;
  139. using ::mbsrtowcs;
  140. using ::putwc;
  141. using ::putwchar;
  142. #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
  143. using ::swprintf;
  144. #endif
  145. using ::swscanf;
  146. using ::ungetwc;
  147. using ::vfwprintf;
  148. #if _GLIBCXX_HAVE_VFWSCANF
  149. using ::vfwscanf;
  150. #endif
  151. #ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
  152. using ::vswprintf;
  153. #endif
  154. #if _GLIBCXX_HAVE_VSWSCANF
  155. using ::vswscanf;
  156. #endif
  157. using ::vwprintf;
  158. #if _GLIBCXX_HAVE_VWSCANF
  159. using ::vwscanf;
  160. #endif
  161. using ::wcrtomb;
  162. using ::wcscat;
  163. using ::wcscmp;
  164. using ::wcscoll;
  165. using ::wcscpy;
  166. using ::wcscspn;
  167. using ::wcsftime;
  168. using ::wcslen;
  169. using ::wcsncat;
  170. using ::wcsncmp;
  171. using ::wcsncpy;
  172. using ::wcsrtombs;
  173. using ::wcsspn;
  174. using ::wcstod;
  175. #if _GLIBCXX_HAVE_WCSTOF
  176. using ::wcstof;
  177. #endif
  178. using ::wcstok;
  179. using ::wcstol;
  180. using ::wcstoul;
  181. using ::wcsxfrm;
  182. using ::wctob;
  183. using ::wmemcmp;
  184. using ::wmemcpy;
  185. using ::wmemmove;
  186. using ::wmemset;
  187. using ::wprintf;
  188. using ::wscanf;
  189. using ::wcschr;
  190. using ::wcspbrk;
  191. using ::wcsrchr;
  192. using ::wcsstr;
  193. using ::wmemchr;
  194. #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
  195. inline wchar_t*
  196. wcschr(wchar_t* __p, wchar_t __c)
  197. { return wcschr(const_cast<const wchar_t*>(__p), __c); }
  198. inline wchar_t*
  199. wcspbrk(wchar_t* __s1, const wchar_t* __s2)
  200. { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
  201. inline wchar_t*
  202. wcsrchr(wchar_t* __p, wchar_t __c)
  203. { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
  204. inline wchar_t*
  205. wcsstr(wchar_t* __s1, const wchar_t* __s2)
  206. { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
  207. inline wchar_t*
  208. wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
  209. { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
  210. #endif
  211. _GLIBCXX_END_NAMESPACE_VERSION
  212. } // namespace
  213. } // extern "C++"
  214. #if _GLIBCXX_USE_C99_WCHAR
  215. #undef wcstold
  216. #undef wcstoll
  217. #undef wcstoull
  218. namespace __gnu_cxx
  219. {
  220. #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
  221. extern "C" long double
  222. (wcstold)(const wchar_t * __restrict, wchar_t ** __restrict) throw ();
  223. #endif
  224. #if !_GLIBCXX_USE_C99_DYNAMIC
  225. using ::wcstold;
  226. #endif
  227. #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
  228. extern "C" long long int
  229. (wcstoll)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
  230. extern "C" unsigned long long int
  231. (wcstoull)(const wchar_t * __restrict, wchar_t ** __restrict, int) throw ();
  232. #endif
  233. #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
  234. using ::wcstoll;
  235. using ::wcstoull;
  236. #endif
  237. } // namespace __gnu_cxx
  238. namespace std
  239. {
  240. using ::__gnu_cxx::wcstold;
  241. using ::__gnu_cxx::wcstoll;
  242. using ::__gnu_cxx::wcstoull;
  243. } // namespace
  244. #endif
  245. #endif //_GLIBCXX_USE_WCHAR_T
  246. #if __cplusplus >= 201103L
  247. #ifdef _GLIBCXX_USE_WCHAR_T
  248. namespace std
  249. {
  250. #if _GLIBCXX_HAVE_WCSTOF
  251. using std::wcstof;
  252. #endif
  253. #if _GLIBCXX_HAVE_VFWSCANF
  254. using std::vfwscanf;
  255. #endif
  256. #if _GLIBCXX_HAVE_VSWSCANF
  257. using std::vswscanf;
  258. #endif
  259. #if _GLIBCXX_HAVE_VWSCANF
  260. using std::vwscanf;
  261. #endif
  262. #if _GLIBCXX_USE_C99_WCHAR
  263. using std::wcstold;
  264. using std::wcstoll;
  265. using std::wcstoull;
  266. #endif
  267. } // namespace
  268. #endif // _GLIBCXX_USE_WCHAR_T
  269. #endif // C++11
  270. #endif