• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6//  See http://www.boost.org/libs/config for most recent version.
7
8//  MACRO:         BOOST_NO_STDC_NAMESPACE
9//  TITLE:         std:: namespace for C API's
10//  DESCRIPTION:   The contents of C++ standard headers for C library
11//                 functions (the <c...> headers) have not been placed
12//                 in namespace std.  This test is difficult - some libraries
13//                 "fake" the std C functions by adding using declarations
14//                 to import them into namespace std, unfortunately they don't
15//                 necessarily catch all of them...
16
17#include <cstring>
18#include <cctype>
19#include <ctime>
20
21#undef isspace
22#undef isalpha
23#undef ispunct
24
25namespace boost_no_stdc_namespace{
26
27
28int test()
29{
30   char c = 0;
31#ifndef BOOST_NO_CTYPE_FUNCTIONS
32   (void)std::isspace(c);
33   (void)std::isalpha(c);
34   (void)std::ispunct(c);
35#endif
36   (void)std::strlen(&c);
37   (void)std::clock();
38
39   return 0;
40}
41
42}
43
44