Add BOOST_NO_CTYPE_FUNCTIONS.

[SVN r11234]
This commit is contained in:
Darin Adler
2001-09-24 19:33:29 +00:00
parent b39d9ae568
commit 25ae369ef7
8 changed files with 132 additions and 3 deletions

View File

@@ -480,6 +480,13 @@ the standard.</p>
<td valign="top" width="33%">If the compiler / library
supplies non-standard or broken std::auto_ptr.</td>
</tr>
<tr>
<td valign="top" width="51%">BOOST_NO_CTYPE_FUNCTIONS</td>
<td valign="top" width="16%">Platform</td>
<td valign="top" width="33%">The Platform does not
provide functions for the character-classifying operations
&lt;ctype.h&gt; and &lt;cctype&gt;, only macros.</td>
</tr>
<tr>
<td valign="top" width="51%">BOOST_NO_CV_SPECIALIZATIONS</td>
<td valign="top" width="16%">Compiler</td>

View File

@@ -0,0 +1,41 @@
// (C) Copyright John Maddock 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// MACRO: BOOST_NO_CTYPE_FUNCTIONS
// TITLE: functions in <ctype.h>
// DESCRIPTION: The Platform does not provide functions for the character-
// classifying operations in <ctype.h>. Some platforms provide
// macros and don't provide functions. Under C++ it's an error
// to provide the macros at all, but that's a separate issue.
#include <ctype.h>
namespace boost_no_ctype_functions {
extern "C" {
typedef int (* character_classify_function)(int);
}
void pass_function(character_classify_function)
{
}
int test()
{
pass_function(isalpha);
pass_function(isalnum);
pass_function(iscntrl);
pass_function(isdigit);
pass_function(isgraph);
pass_function(islower);
pass_function(isprint);
pass_function(ispunct);
pass_function(isspace);
pass_function(isupper);
pass_function(isxdigit);
return 0;
}
}

View File

@@ -9,8 +9,8 @@
//
// Note that some platforms put these prototypes in the wrong headers,
// we have to include prretty well all the string headers on the chance that
// one of them will contain what we want!!
// we have to include pretty well all the string headers on the chance that
// one of them will contain what we want!
//
#include <cwctype>
#include <wctype.h>

View File

@@ -828,6 +828,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_MSVC6_MEMBER_TEMPLATES);
PRINT_MACRO(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP);
PRINT_MACRO(BOOST_NO_AUTO_PTR);
PRINT_MACRO(BOOST_NO_CTYPE_FUNCTIONS);
PRINT_MACRO(BOOST_NO_CV_SPECIALIZATIONS);
PRINT_MACRO(BOOST_NO_CV_VOID_SPECIALIZATIONS);
PRINT_MACRO(BOOST_NO_CWCHAR);

View File

@@ -10,7 +10,7 @@
// Do not edit this file, it was generated automatically by
// ../tools/generate from boost_*.cxx on
// Sun Sep 16 11:09:13 2001
// Mon Sep 24 11:11:14 PDT 2001
#include <boost/config.hpp>
#define BOOST_INCLUDE_MAIN
@@ -27,6 +27,11 @@ namespace boost_no_argument_dependent_lookup = empty_boost;
#else
namespace boost_no_auto_ptr = empty_boost;
#endif
#ifndef BOOST_NO_CTYPE_FUNCTIONS
#include "boost_no_ctype_functions.cxx"
#else
namespace boost_no_ctype_functions = empty_boost;
#endif
#ifndef BOOST_NO_CV_SPECIALIZATIONS
#include "boost_no_cv_spec.cxx"
#else
@@ -299,6 +304,7 @@ int test_main( int, char *[] )
BOOST_TEST(0 == boost_no_cwchar::test());
BOOST_TEST(0 == boost_no_cv_void_specializations::test());
BOOST_TEST(0 == boost_no_cv_specializations::test());
BOOST_TEST(0 == boost_no_ctype_functions::test());
BOOST_TEST(0 == boost_no_auto_ptr::test());
BOOST_TEST(0 == boost_no_argument_dependent_lookup::test());
BOOST_TEST(0 == boost_has_winthreads::test());

View File

@@ -0,0 +1,36 @@
// (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// Test file for macro BOOST_NO_CTYPE_FUNCTIONS
// This file should not compile, if it does then
// BOOST_NO_CTYPE_FUNCTIONS need not be defined.
// see boost_no_ctype_functions.cxx for more details
// Do not edit this file, it was generated automatically by
// ../tools/generate from boost_no_ctype_functions.cxx on
// Mon Sep 24 11:11:14 PDT 2001
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include <boost/test/cpp_main.cpp>
#include "test.hpp"
#ifdef BOOST_NO_CTYPE_FUNCTIONS
#include "boost_no_ctype_functions.cxx"
#else
#error "this file should not compile"
#endif
int cpp_main( int, char *[] )
{
return boost_no_ctype_functions::test();
}

View File

@@ -0,0 +1,36 @@
// (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// Test file for macro BOOST_NO_CTYPE_FUNCTIONS
// This file should compile, if it does not then
// BOOST_NO_CTYPE_FUNCTIONS needs to be defined.
// see boost_no_ctype_functions.cxx for more details
// Do not edit this file, it was generated automatically by
// ../tools/generate from boost_no_ctype_functions.cxx on
// Mon Sep 24 11:11:14 PDT 2001
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include <boost/test/cpp_main.cpp>
#include "test.hpp"
#ifndef BOOST_NO_CTYPE_FUNCTIONS
#include "boost_no_ctype_functions.cxx"
#else
namespace boost_no_ctype_functions = empty_boost;
#endif
int cpp_main( int, char *[] )
{
return boost_no_ctype_functions::test();
}

View File

@@ -9,6 +9,8 @@ run libs/config/test/no_arg_dep_lookup_pass.cpp
link-fail libs/config/test/no_arg_dep_lookup_fail.cpp
run libs/config/test/no_auto_ptr_pass.cpp
link-fail libs/config/test/no_auto_ptr_fail.cpp
run libs/config/test/no_ctype_functions_pass.cpp
link-fail libs/config/test/no_ctype_functions_fail.cpp
run libs/config/test/no_cv_spec_pass.cpp
link-fail libs/config/test/no_cv_spec_fail.cpp
run libs/config/test/no_cv_void_spec_pass.cpp