From 25ae369ef7bcb70dc7bea45380b0bb836bb58a9a Mon Sep 17 00:00:00 2001
From: Darin Adler
Date: Mon, 24 Sep 2001 19:33:29 +0000
Subject: [PATCH] Add BOOST_NO_CTYPE_FUNCTIONS.
[SVN r11234]
---
config.htm | 7 ++++++
test/boost_no_ctype_functions.ipp | 41 +++++++++++++++++++++++++++++++
test/boost_no_cwctype.ipp | 4 +--
test/config_info.cpp | 1 +
test/config_test.cpp | 8 +++++-
test/no_ctype_functions_fail.cpp | 36 +++++++++++++++++++++++++++
test/no_ctype_functions_pass.cpp | 36 +++++++++++++++++++++++++++
test/regression.cfg | 2 ++
8 files changed, 132 insertions(+), 3 deletions(-)
create mode 100644 test/boost_no_ctype_functions.ipp
create mode 100644 test/no_ctype_functions_fail.cpp
create mode 100644 test/no_ctype_functions_pass.cpp
diff --git a/config.htm b/config.htm
index 87c8ba6b..83f6237e 100644
--- a/config.htm
+++ b/config.htm
@@ -480,6 +480,13 @@ the standard.
If the compiler / library
supplies non-standard or broken std::auto_ptr. |
+
+ BOOST_NO_CTYPE_FUNCTIONS |
+ Platform |
+ The Platform does not
+ provide functions for the character-classifying operations
+ <ctype.h> and <cctype>, only macros. |
+
BOOST_NO_CV_SPECIALIZATIONS |
Compiler |
diff --git a/test/boost_no_ctype_functions.ipp b/test/boost_no_ctype_functions.ipp
new file mode 100644
index 00000000..e6457b9d
--- /dev/null
+++ b/test/boost_no_ctype_functions.ipp
@@ -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
+// DESCRIPTION: The Platform does not provide functions for the character-
+// classifying operations in . 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
+
+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;
+}
+
+}
diff --git a/test/boost_no_cwctype.ipp b/test/boost_no_cwctype.ipp
index c82bdb2d..311e43c4 100644
--- a/test/boost_no_cwctype.ipp
+++ b/test/boost_no_cwctype.ipp
@@ -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
#include
diff --git a/test/config_info.cpp b/test/config_info.cpp
index 56c9f076..5c869c93 100644
--- a/test/config_info.cpp
+++ b/test/config_info.cpp
@@ -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);
diff --git a/test/config_test.cpp b/test/config_test.cpp
index 2a430e2c..9329773b 100644
--- a/test/config_test.cpp
+++ b/test/config_test.cpp
@@ -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
#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());
diff --git a/test/no_ctype_functions_fail.cpp b/test/no_ctype_functions_fail.cpp
new file mode 100644
index 00000000..16585728
--- /dev/null
+++ b/test/no_ctype_functions_fail.cpp
@@ -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
+#include
+#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();
+}
+
diff --git a/test/no_ctype_functions_pass.cpp b/test/no_ctype_functions_pass.cpp
new file mode 100644
index 00000000..ab849e77
--- /dev/null
+++ b/test/no_ctype_functions_pass.cpp
@@ -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
+#include
+#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();
+}
+
diff --git a/test/regression.cfg b/test/regression.cfg
index bbcc176c..8bf28262 100644
--- a/test/regression.cfg
+++ b/test/regression.cfg
@@ -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