9
3

wcslen.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef BOOST_ARCHIVE_WCSLEN_HPP
  2. #define BOOST_ARCHIVE_WCSLEN_HPP
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER)
  5. # pragma once
  6. #endif
  7. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  8. // wcslen.hpp:
  9. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  10. // Use, modification and distribution is subject to the Boost Software
  11. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. // See http://www.boost.org for updates, documentation, and revision history.
  14. #include <cstddef> // size_t
  15. #include <boost/config.hpp>
  16. #if defined(BOOST_NO_STDC_NAMESPACE)
  17. namespace std{
  18. using ::size_t;
  19. } // namespace std
  20. #endif
  21. #ifndef BOOST_NO_CWCHAR
  22. // a couple of libraries which include wchar_t don't include
  23. // wcslen
  24. #if defined(BOOST_DINKUMWARE_STDLIB) && BOOST_DINKUMWARE_STDLIB < 306 \
  25. || defined(__LIBCOMO__)
  26. namespace std {
  27. inline std::size_t wcslen(const wchar_t * ws)
  28. {
  29. const wchar_t * eows = ws;
  30. while(* eows != 0)
  31. ++eows;
  32. return eows - ws;
  33. }
  34. } // namespace std
  35. #else
  36. #ifndef BOOST_NO_CWCHAR
  37. #include <cwchar>
  38. #endif
  39. #ifdef BOOST_NO_STDC_NAMESPACE
  40. namespace std{ using ::wcslen; }
  41. #endif
  42. #endif // wcslen
  43. #endif //BOOST_NO_CWCHAR
  44. #endif //BOOST_ARCHIVE_WCSLEN_HPP