boost_no_stdc_namespace.ipp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // (C) Copyright John Maddock 2001.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_NO_STDC_NAMESPACE
  7. // TITLE: std:: namespace for C API's
  8. // DESCRIPTION: The contents of C++ standard headers for C library
  9. // functions (the <c...> headers) have not been placed
  10. // in namespace std. This test is difficult - some libraries
  11. // "fake" the std C functions by adding using declarations
  12. // to import them into namespace std, unfortunately they don't
  13. // necessarily catch all of them...
  14. #include <cstring>
  15. #include <cctype>
  16. #include <ctime>
  17. #undef isspace
  18. #undef isalpha
  19. #undef ispunct
  20. namespace boost_no_stdc_namespace{
  21. int test()
  22. {
  23. char c = 0;
  24. #ifndef BOOST_NO_CTYPE_FUNCTIONS
  25. (void)std::isspace(c);
  26. (void)std::isalpha(c);
  27. (void)std::ispunct(c);
  28. #endif
  29. (void)std::strlen(&c);
  30. (void)std::clock();
  31. return 0;
  32. }
  33. }