diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b1859d26e0a01125edde56d6eb403e6a5bd494b..fb5e36bfacb9a67dfec4c781a0b51b188f4c39df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -350,8 +350,6 @@ KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_CSTDDEF SET(KWSYS_PLATFORM_CXX_TEST_DEFINES -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}) -KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_NEQ_CHAR - "Checking whether stl string has operator!= for char*" DIRECT) KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ITERATOR_TRAITS "Checking whether stl has iterator_traits" DIRECT) IF(KWSYS_STL_HAS_ITERATOR_TRAITS) @@ -383,17 +381,6 @@ ELSE() ENDIF() KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_OBJECTS "Checking whether stl containers support allocator objects." DIRECT) -IF(NOT WATCOM) - # ANSI streams always have string operators. - SET(KWSYS_STL_STRING_HAVE_OSTREAM 1) - SET(KWSYS_STL_STRING_HAVE_ISTREAM 1) -ELSE() - # There may not be string operators for old streams. - KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_OSTREAM - "Checking whether stl string has ostream operator<<" DIRECT) - KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_ISTREAM - "Checking whether stl string has istream operator>>" DIRECT) -ENDIF() KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS "Checking whether \"<>\" is needed for template friends" INVERT) @@ -784,7 +771,6 @@ ENDIF() #----------------------------------------------------------------------------- # Create STL header wrappers to block warnings in the STL headers and # give standard names by which they may be included. -SET(KWSYS_STL_HEADER_EXTRA_string 1) FOREACH(header algorithm deque @@ -806,20 +792,6 @@ FOREACH(header ) # Configure the header wrapper. SET(KWSYS_STL_HEADER "${header}") - IF(KWSYS_STL_HEADER_EXTRA_${header}) - SET(KWSYS_STL_HEADER_EXTRA - "#define ${KWSYS_NAMESPACE}_stl_${header}_including_hxx\n# include <${KWSYS_NAMESPACE}/stl/${header}.hxx>\n#undef ${KWSYS_NAMESPACE}_stl_${header}_including_hxx\n") - CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl_${header}.hxx.in - ${KWSYS_HEADER_DIR}/stl/${header}.hxx - @ONLY IMMEDIATE) - IF(KWSYS_INSTALL_INCLUDE_DIR) - INSTALL(FILES ${KWSYS_HEADER_DIR}/stl/${header}.hxx - DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl - ${KWSYS_INSTALL_INCLUDE_OPTIONS}) - ENDIF() - ELSE() - SET(KWSYS_STL_HEADER_EXTRA "") - ENDIF() CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl.hxx.in ${KWSYS_HEADER_DIR}/stl/${header} @ONLY IMMEDIATE) diff --git a/Configure.hxx.in b/Configure.hxx.in index e0c436488eeebb5fcc48eef39a5a9384525d75ef..228a35db8e9121214061ede6814513975436dace 100644 --- a/Configure.hxx.in +++ b/Configure.hxx.in @@ -21,15 +21,6 @@ /* Whether wstring is available. */ #define @KWSYS_NAMESPACE@_STL_HAS_WSTRING @KWSYS_STL_HAS_WSTRING@ -/* Whether the STL string has operator<< for ostream. */ -#define @KWSYS_NAMESPACE@_STL_STRING_HAVE_OSTREAM @KWSYS_STL_STRING_HAVE_OSTREAM@ - -/* Whether the STL string has operator>> for istream. */ -#define @KWSYS_NAMESPACE@_STL_STRING_HAVE_ISTREAM @KWSYS_STL_STRING_HAVE_ISTREAM@ - -/* Whether the STL string has operator!= for char*. */ -#define @KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR @KWSYS_STL_STRING_HAVE_NEQ_CHAR@ - /* Define the stl namespace macro. */ #if @KWSYS_NAMESPACE@_STL_HAVE_STD # define @KWSYS_NAMESPACE@_stl std @@ -111,9 +102,6 @@ # define KWSYS_STL_HAVE_STD @KWSYS_NAMESPACE@_STL_HAVE_STD # define KWSYS_STAT_HAS_ST_MTIM @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM # define KWSYS_CXX_HAS_CSTDDEF @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF -# define KWSYS_STL_STRING_HAVE_OSTREAM @KWSYS_NAMESPACE@_STL_STRING_HAVE_OSTREAM -# define KWSYS_STL_STRING_HAVE_ISTREAM @KWSYS_NAMESPACE@_STL_STRING_HAVE_ISTREAM -# define KWSYS_STL_STRING_HAVE_NEQ_CHAR @KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR # define KWSYS_CXX_NULL_TEMPLATE_ARGS @KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS # define KWSYS_CXX_HAS_MEMBER_TEMPLATES @KWSYS_NAMESPACE@_CXX_HAS_MEMBER_TEMPLATES # define KWSYS_CXX_HAS_FULL_SPECIALIZATION @KWSYS_NAMESPACE@_CXX_HAS_FULL_SPECIALIZATION diff --git a/Directory.cxx b/Directory.cxx index 58cea635506303cfdbf334454e6afb514a43a7c0..41e170eb235ab19ca841cb7d06f44d4b41f20910 100644 --- a/Directory.cxx +++ b/Directory.cxx @@ -26,7 +26,6 @@ # include "Configure.hxx.in" # include "Encoding.hxx.in" # include "kwsys_stl.hxx.in" -# include "kwsys_stl_string.hxx.in" # include "kwsys_stl_vector.hxx.in" #endif diff --git a/Glob.cxx b/Glob.cxx index 1567b6429903c7a329ce48868228cbd3a12db263..9d25e2884e56b7ab9ca6e1c08c75b65f093bfb4f 100644 --- a/Glob.cxx +++ b/Glob.cxx @@ -30,7 +30,6 @@ # include "RegularExpression.hxx.in" # include "SystemTools.hxx.in" # include "kwsys_stl.hxx.in" -# include "kwsys_stl_string.hxx.in" # include "kwsys_stl_vector.hxx.in" # include "kwsys_stl_algorithm.hxx.in" #endif diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx index 401ab29aa41a081dd51a85d020894f3509f001d3..d6e755bf1f819d8ea12dc888aae08f4282583fa9 100644 --- a/kwsysPlatformTestsCXX.cxx +++ b/kwsysPlatformTestsCXX.cxx @@ -24,26 +24,6 @@ void f(std ::list<int>*) {} int main() { return 0; } #endif -#ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM -# include <iostream> -# include <string> -void f(ostream& os, const kwsys_stl::string& s) { os << s; } -int main() { return 0; } -#endif - -#ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM -# include <iostream> -# include <string> -void f(istream& is, kwsys_stl::string& s) { is >> s; } -int main() { return 0; } -#endif - -#ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -# include <string> -bool f(const kwsys_stl::string& s) { return s != ""; } -int main() { return 0; } -#endif - #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include <cstdio> int main() { return 0; } diff --git a/kwsys_stl.hxx.in b/kwsys_stl.hxx.in index 610e6d47115f30cb6474b6e574c1cddd01677c93..b448d8ad132f923860e557a00fad490746d7847e 100644 --- a/kwsys_stl.hxx.in +++ b/kwsys_stl.hxx.in @@ -45,5 +45,4 @@ # pragma warning(pop) #endif -@KWSYS_STL_HEADER_EXTRA@ #endif diff --git a/kwsys_stl_string.hxx.in b/kwsys_stl_string.hxx.in deleted file mode 100644 index dbc7f6373c6e32c48c63d9eecd425d9e8f8d48d2..0000000000000000000000000000000000000000 --- a/kwsys_stl_string.hxx.in +++ /dev/null @@ -1,123 +0,0 @@ -/*============================================================================ - KWSys - Kitware System Library - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ - -// This header is extra code for <@KWSYS_NAMESPACE@/stl/string>. -#if !defined(@KWSYS_NAMESPACE@_stl_string_including_hxx) -# error "The header <@KWSYS_NAMESPACE@/stl/string.hxx> may be included only by <@KWSYS_NAMESPACE@/stl/string>." -#endif - -// Provide the istream operator for the stl string if it is not -// provided by the system or another copy of kwsys. Allow user code -// to block this definition by defining the macro -// @KWSYS_NAMESPACE@_STL_STRING_NO_ISTREAM -// to avoid conflicts with other libraries. User code can test for -// this definition by checking the macro -// @KWSYS_NAMESPACE@_STL_STRING_ISTREAM_DEFINED -#if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_ISTREAM && !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_ISTREAM) && !defined(KWSYS_STL_STRING_ISTREAM_DEFINED) -# define KWSYS_STL_STRING_ISTREAM_DEFINED -# define @KWSYS_NAMESPACE@_STL_STRING_ISTREAM_DEFINED -# include <ctype.h> // isspace -# include <iostream> -# if defined(__WATCOMC__) -namespace @KWSYS_NAMESPACE@ -{ -struct ios_istream_hack: public std::istream -{ void eatwhite() { this->std::istream::eatwhite(); } }; -} -# endif -inline std::istream& -operator>>(std::istream& is, - @KWSYS_NAMESPACE@_stl::string& s) -{ - // Keep track of the resulting state. - int state = std::ios::goodbit; - - // Save the width setting and set it back to zero. - size_t n = static_cast<size_t>(is.width(0)); - - // Clear any old contents of the output string. - s.erase(); - - // Skip leading whitespace. -#if defined(__WATCOMC__) - static_cast<@KWSYS_NAMESPACE@::ios_istream_hack&>(is).eatwhite(); -#else - is.eatwhite(); -#endif - std::istream& okay = is; - - if(okay) - { - // Select a maximum possible length. - if(n == 0 || n >= s.max_size()) - { - n = s.max_size(); - } - - // Read until a space is found or the maximum length is reached. - bool success = false; - for(int c = is.peek(); (--n > 0 && c != EOF && !isspace(c)); c = is.peek()) - { - s += static_cast<char>(c); - success = true; - is.ignore(); - } - - // Set flags for resulting state. - if(is.peek() == EOF) { state |= std::ios::eofbit; } - if(!success) { state |= std::ios::failbit; } - } - - // Set the final result state. - is.clear(state); - return is; -} -#endif - -// Provide the ostream operator for the stl string if it is not -// provided by the system or another copy of kwsys. Allow user code -// to block this definition by defining the macro -// @KWSYS_NAMESPACE@_STL_STRING_NO_OSTREAM -// to avoid conflicts with other libraries. User code can test for -// this definition by checking the macro -// @KWSYS_NAMESPACE@_STL_STRING_OSTREAM_DEFINED -#if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_OSTREAM && !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_OSTREAM) && !defined(KWSYS_STL_STRING_OSTREAM_DEFINED) -# define KWSYS_STL_STRING_OSTREAM_DEFINED -# define @KWSYS_NAMESPACE@_STL_STRING_OSTREAM_DEFINED -# include <iostream> -inline std::ostream& -operator<<(std::ostream& os, - @KWSYS_NAMESPACE@_stl::string const& s) -{ - return os << s.c_str(); -} -#endif - -// Provide the operator!= for the stl string and char* if it is not -// provided by the system or another copy of kwsys. Allow user code -// to block this definition by defining the macro -// @KWSYS_NAMESPACE@_STL_STRING_NO_NEQ_CHAR -// to avoid conflicts with other libraries. User code can test for -// this definition by checking the macro -// @KWSYS_NAMESPACE@_STL_STRING_NEQ_CHAR_DEFINED -#if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR && !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_NEQ_CHAR) && !defined(KWSYS_STL_STRING_NEQ_CHAR_DEFINED) -# define KWSYS_STL_STRING_NEQ_CHAR_DEFINED -# define @KWSYS_NAMESPACE@_STL_STRING_NEQ_CHAR_DEFINED -inline bool operator!=(@KWSYS_NAMESPACE@_stl::string const& s, const char* c) -{ - return !(s == c); -} -inline bool operator!=(const char* c, @KWSYS_NAMESPACE@_stl::string const& s) -{ - return !(s == c); -} -#endif diff --git a/testDynamicLoader.cxx b/testDynamicLoader.cxx index 0902bfe52dc7dd263b9e6a635e0e242f122966ce..9c1a2b5bdb6e6baa3264327040228c891c6075fb 100644 --- a/testDynamicLoader.cxx +++ b/testDynamicLoader.cxx @@ -22,7 +22,6 @@ // duplicate the above list of headers. #if 0 # include "DynamicLoader.hxx.in" -# include "kwsys_stl_string.hxx.in" #endif #include <iostream> diff --git a/testIOS.cxx b/testIOS.cxx index 63b467a5e3ca48d64ef815af8b9178cdb7cf241d..7597dae4e9231c7b1baf69ff1ac6fb1dc39705cf 100644 --- a/testIOS.cxx +++ b/testIOS.cxx @@ -15,7 +15,6 @@ // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 -# include "kwsys_stl_string.hxx.in" # include "kwsys_stl_vector.h.in" #endif