From b08e5f8ab515e06a12592b4b7c7c166359c26c59 Mon Sep 17 00:00:00 2001 From: jez Date: Wed, 6 Aug 2008 23:05:53 +0100 Subject: [PATCH] Visual Studio 6 hasn't been a build target for some time now. Removed the left over bits of VS6 specific workarounds. --- include/Arabica/StringAdaptor.hpp | 4 ---- include/Arabica/impl/VS6Workaround.hpp | 28 ------------------------- include/SAX/wrappers/saxexpat.hpp | 4 ---- include/SAX/wrappers/saxlibxml2.hpp | 4 ---- include/SAX/wrappers/saxxerces.hpp | 24 --------------------- include/convert/base64codecvt.hpp | 4 ---- include/convert/iso88591utf8codecvt.hpp | 6 ------ include/convert/rot13codecvt.hpp | 3 --- include/convert/ucs2utf8codecvt.hpp | 4 ---- include/convert/utf16beucs2codecvt.hpp | 4 ---- include/convert/utf16leucs2codecvt.hpp | 4 ---- include/convert/utf16utf8codecvt.hpp | 4 ---- include/convert/utf8iso88591codecvt.hpp | 6 ------ include/convert/utf8ucs2codecvt.hpp | 4 ---- include/io/convert_adaptor.hpp | 13 +----------- include/io/convertstream.hpp | 22 +------------------ include/io/socket_stream.hpp | 8 ------- src/convert/rot13codecvt.cpp | 3 --- src/convert/utf16beucs2codecvt.cpp | 3 --- src/convert/utf16leucs2codecvt.cpp | 3 --- 20 files changed, 2 insertions(+), 153 deletions(-) delete mode 100644 include/Arabica/impl/VS6Workaround.hpp diff --git a/include/Arabica/StringAdaptor.hpp b/include/Arabica/StringAdaptor.hpp index 2ff34014..8b62c7bb 100644 --- a/include/Arabica/StringAdaptor.hpp +++ b/include/Arabica/StringAdaptor.hpp @@ -87,11 +87,7 @@ public: static const std::locale& utf8ucs2_locale() { -#ifndef ARABICA_VS6_WORKAROUND static const std::locale loc = std::locale(std::locale(), new Arabica::convert::utf8ucs2codecvt); -#else - static const std::locale loc(std::_Addfac(std::locale(), new Arabica::convert::utf8ucs2codecvt())); -#endif return loc; } #endif //ARABICA_NO_WCHAR_T diff --git a/include/Arabica/impl/VS6Workaround.hpp b/include/Arabica/impl/VS6Workaround.hpp deleted file mode 100644 index 92a3cd2d..00000000 --- a/include/Arabica/impl/VS6Workaround.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ARABICA_VS6_WORKAROUND_H -#define ARABICA_VS6_WORKAROUND_H - -#ifndef ARABICA_VS6_WORKAROUND -#error "This file is only for use in Visual C++/Studio v6 builds." -#endif - -#undef max -#undef min - -namespace std { - typedef ::mbstate_t mbstate_t; - - template - T max(T a, T b) - { - return (a > b) ? a : b; - } - - template - T min(T a, T b) - { - return (a < b) ? a : b; - } -} - - -#endif diff --git a/include/SAX/wrappers/saxexpat.hpp b/include/SAX/wrappers/saxexpat.hpp index be165ba9..3361dddd 100644 --- a/include/SAX/wrappers/saxexpat.hpp +++ b/include/SAX/wrappers/saxexpat.hpp @@ -514,11 +514,7 @@ bool expat_wrapper::do_parse(inputSourceT& source, XML_Pars } // do_parse template -#ifndef ARABICA_VS6_WORKAROUND std::auto_ptr::PropertyBaseT> expat_wrapper::doGetProperty(const string_type& name) -#else -std::auto_ptr::PropertyBaseT> expat_wrapper::doGetProperty(const string_type& name) -#endif { if(name == properties_.lexicalHandler) { diff --git a/include/SAX/wrappers/saxlibxml2.hpp b/include/SAX/wrappers/saxlibxml2.hpp index 5d645b57..530c372d 100644 --- a/include/SAX/wrappers/saxlibxml2.hpp +++ b/include/SAX/wrappers/saxlibxml2.hpp @@ -333,11 +333,7 @@ void libxml2_wrapper::setFeature(const string_type& name, b } // setFeature template -#ifndef ARABICA_VS6_WORKAROUND std::auto_ptr::PropertyBaseT> libxml2_wrapper::doGetProperty(const string_type& name) -#else -std::auto_ptr::PropertyBaseT> libxml2_wrapper::doGetProperty(const string_type& name) -#endif { if(name == properties_.declHandler) { diff --git a/include/SAX/wrappers/saxxerces.hpp b/include/SAX/wrappers/saxxerces.hpp index 757fa032..186a4a16 100644 --- a/include/SAX/wrappers/saxxerces.hpp +++ b/include/SAX/wrappers/saxxerces.hpp @@ -934,31 +934,19 @@ void xerces_wrapper::setFeature(const string_type& name, bo } // setFeature template -#ifndef ARABICA_VS6_WORKAROUND std::auto_ptr::XMLReaderT::PropertyBase> xerces_wrapper::doGetProperty(const string_type& name) -#else - std::auto_ptr::XMLReaderT::PropertyBase> xerces_wrapper::doGetProperty(const string_type& name) -#endif { if(name == properties_.lexicalHandler) { typedef typename XMLReaderT::template Property Prop; Prop *prop = new Prop(lexicalHandlerAdaptor_.getLexicalHandler()); -#ifndef ARABICA_VS6_WORKAROUND return std::auto_ptr(prop); -#else - return std::auto_ptr(prop); -#endif } if(name == properties_.declHandler) { typedef typename XMLReaderT::template Property Prop; Prop* prop = new Prop(declHandlerAdaptor_.getDeclHandler()); -#ifndef ARABICA_VS6_WORKAROUND return std::auto_ptr(prop); -#else - return std::auto_ptr(prop); -#endif } if (name == properties_.externalSchemaLocation) { @@ -969,11 +957,7 @@ std::auto_ptr::XMLReaderT::Property XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchemaExternalSchemaLocation)); externalSchemaLocation_ = XSA::makeStringT(xercesExternalSchemaLocation); -#ifndef ARABICA_VS6_WORKAROUND std::auto_ptr toReturn(new StringPropertyType(externalSchemaLocation_)); -#else - std::auto_ptr toReturn(new StringPropertyType(externalSchemaLocation_)); -#endif #ifdef SAXXERCES_DEBUG std::cerr << "Returning " << typeid(toReturn) << "(*(" << typeid(*toReturn.get()) << ")" @@ -992,21 +976,13 @@ std::auto_ptr::XMLReaderT::Property XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation)); externalNoNamespaceSchemaLocation_ = XSA::makeStringT(xercesExternalNoNamespaceSchemaLocation); -#ifndef ARABICA_VS6_WORKAROUND return std::auto_ptr(new StringPropertyType(externalNoNamespaceSchemaLocation_)); -#else - return std::auto_ptr(new StringPropertyType(externalNoNamespaceSchemaLocation_)); -#endif } throw SAX::SAXNotRecognizedException("Property not recognized "); } // doGetProperty template -#ifndef ARABICA_VS6_WORKAROUND void xerces_wrapper::doSetProperty(const string_type& name, std::auto_ptr value) -#else -void xerces_wrapper::doSetProperty(const string_type& name, std::auto_ptr value) -#endif { if(name == properties_.lexicalHandler) { diff --git a/include/convert/base64codecvt.hpp b/include/convert/base64codecvt.hpp index 0feec939..22c8d7ca 100644 --- a/include/convert/base64codecvt.hpp +++ b/include/convert/base64codecvt.hpp @@ -10,10 +10,6 @@ #include #include -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif - namespace Arabica { namespace convert diff --git a/include/convert/iso88591utf8codecvt.hpp b/include/convert/iso88591utf8codecvt.hpp index f61f1e5e..b1ce5a8e 100644 --- a/include/convert/iso88591utf8codecvt.hpp +++ b/include/convert/iso88591utf8codecvt.hpp @@ -4,12 +4,6 @@ #include #include -#ifdef ARABICA_VS6_WORKAROUND -namespace std { - typedef ::mbstate_t mbstate_t; -} -#endif - namespace Arabica { namespace convert diff --git a/include/convert/rot13codecvt.hpp b/include/convert/rot13codecvt.hpp index 7cd7d621..4bc0b2b3 100644 --- a/include/convert/rot13codecvt.hpp +++ b/include/convert/rot13codecvt.hpp @@ -9,9 +9,6 @@ #include #include #include -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif namespace Arabica { diff --git a/include/convert/ucs2utf8codecvt.hpp b/include/convert/ucs2utf8codecvt.hpp index 74910733..1fd330c1 100644 --- a/include/convert/ucs2utf8codecvt.hpp +++ b/include/convert/ucs2utf8codecvt.hpp @@ -18,10 +18,6 @@ #include #endif -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif - namespace Arabica { namespace convert diff --git a/include/convert/utf16beucs2codecvt.hpp b/include/convert/utf16beucs2codecvt.hpp index 4251229c..6c1e3bae 100644 --- a/include/convert/utf16beucs2codecvt.hpp +++ b/include/convert/utf16beucs2codecvt.hpp @@ -16,10 +16,6 @@ #include #endif -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif - namespace Arabica { namespace convert diff --git a/include/convert/utf16leucs2codecvt.hpp b/include/convert/utf16leucs2codecvt.hpp index 15b963ec..2a107aa8 100644 --- a/include/convert/utf16leucs2codecvt.hpp +++ b/include/convert/utf16leucs2codecvt.hpp @@ -16,10 +16,6 @@ #include #endif -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif - namespace Arabica { namespace convert diff --git a/include/convert/utf16utf8codecvt.hpp b/include/convert/utf16utf8codecvt.hpp index b46ffc83..cf0e2b95 100644 --- a/include/convert/utf16utf8codecvt.hpp +++ b/include/convert/utf16utf8codecvt.hpp @@ -20,10 +20,6 @@ #include #endif -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif - namespace Arabica { namespace convert diff --git a/include/convert/utf8iso88591codecvt.hpp b/include/convert/utf8iso88591codecvt.hpp index 74898c24..9dee04ae 100644 --- a/include/convert/utf8iso88591codecvt.hpp +++ b/include/convert/utf8iso88591codecvt.hpp @@ -4,12 +4,6 @@ #include #include -#ifdef ARABICA_VS6_WORKAROUND -namespace std { - typedef ::mbstate_t mbstate_t; -} -#endif - namespace Arabica { namespace convert diff --git a/include/convert/utf8ucs2codecvt.hpp b/include/convert/utf8ucs2codecvt.hpp index 1d339e77..c30a9694 100644 --- a/include/convert/utf8ucs2codecvt.hpp +++ b/include/convert/utf8ucs2codecvt.hpp @@ -20,10 +20,6 @@ #include #endif -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif - namespace Arabica { namespace convert diff --git a/include/io/convert_adaptor.hpp b/include/io/convert_adaptor.hpp index 0332e555..e1d49e9a 100644 --- a/include/io/convert_adaptor.hpp +++ b/include/io/convert_adaptor.hpp @@ -22,9 +22,6 @@ #include #include -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif namespace Arabica { @@ -147,11 +144,7 @@ bool convert_bufadaptor::flushOu bool ok(true); const std::codecvt& cvt = -#ifndef ARABICA_VS6_WORKAROUND std::use_facet >(this->getloc()); -#else - std::use_facet(this->getloc(), (std::codecvt*)0, true); -#endif if(cvt.always_noconv()) std::copy(&outBuffer_[0], &outBuffer_[0] + length, std::ostreambuf_iterator(externalbuf_)); @@ -199,11 +192,7 @@ std::streamsize convert_bufadaptor& cvt = -#ifndef ARABICA_VS6_WORKAROUND - std::use_facet >(this->getloc()); -#else - std::use_facet(this->getloc(), (std::codecvt*)0, true); -#endif + std::use_facet >(this->getloc()); externalCharT from[1024]; diff --git a/include/io/convertstream.hpp b/include/io/convertstream.hpp index 64606752..26bb317d 100644 --- a/include/io/convertstream.hpp +++ b/include/io/convertstream.hpp @@ -122,13 +122,8 @@ public: void str(const fromStringT& str) { // do conversion -#ifndef ARABICA_VS6_WORKAROUND const std::codecvt& cvt = std::use_facet >(this->getloc()); -#else - const std::codecvt& cvt = - std::use_facet(convertstreambuf_initT::buf()->getloc(), (std::codecvt*)0, true); -#endif if(cvt.always_noconv()) { @@ -165,14 +160,9 @@ private: { stringT dest; -#ifndef ARABICA_VS6_WORKAROUND std::back_insert_iterator id(dest); for(typename fromStringT::const_iterator i = str.begin(); i != str.end(); ++i, ++id) *id = static_cast(*i); -#else - for(typename fromStringT::const_iterator i = str.begin(); i != str.end(); ++i) - dest += static_cast(*i); -#endif return dest; } // no_conversion @@ -226,13 +216,8 @@ public: return out; // convert it here -#ifndef ARABICA_VS6_WORKAROUND const std::codecvt& cvt = std::use_facet >(this->getloc()); -#else - const std::codecvt& cvt = - std::use_facet(getloc(), (std::codecvt*)0, true); -#endif if(cvt.always_noconv()) out.append(no_conversion(newstuff)); @@ -274,14 +259,9 @@ private: { toStringT dest; -#ifndef ARABICA_VS6_WORKAROUND - std::back_insert_iterator id(dest); + std::back_insert_iterator id(dest); for(typename stringT::const_iterator i = str.begin(); i != str.end(); ++i, ++id) *id = static_cast(*i); -#else - for(typename stringT::const_iterator i = str.begin(); i != str.end(); ++i) - dest += static_cast(*i); -#endif return dest; } // no_conversion diff --git a/include/io/socket_stream.hpp b/include/io/socket_stream.hpp index de5f714e..e7b8e7b0 100644 --- a/include/io/socket_stream.hpp +++ b/include/io/socket_stream.hpp @@ -33,10 +33,6 @@ # define INADDR_NONE ((in_addr_t) -1) #endif -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif - namespace Arabica { namespace io @@ -50,7 +46,6 @@ class basic_socketbuf : public std::basic_streambuf public: typedef typename traitsT::int_type int_type; -#ifndef ARABICA_VS6_WORKAROUND using std::basic_streambuf::setp; using std::basic_streambuf::setg; using std::basic_streambuf::underflow; @@ -59,7 +54,6 @@ class basic_socketbuf : public std::basic_streambuf using std::basic_streambuf::egptr; using std::basic_streambuf::eback; using std::basic_streambuf::pptr; -#endif basic_socketbuf(); virtual ~basic_socketbuf(); @@ -358,10 +352,8 @@ class basic_socketstream : public std::basic_iostream { public: -#ifndef ARABICA_VS6_WORKAROUND using std::basic_iostream::setstate; using std::basic_iostream::badbit; -#endif basic_socketstream(); explicit basic_socketstream(const char* hostname, int port); diff --git a/src/convert/rot13codecvt.cpp b/src/convert/rot13codecvt.cpp index 7fd80dae..88310286 100644 --- a/src/convert/rot13codecvt.cpp +++ b/src/convert/rot13codecvt.cpp @@ -5,9 +5,6 @@ /////////////////////////////////////////// #include -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif using namespace Arabica::convert; diff --git a/src/convert/utf16beucs2codecvt.cpp b/src/convert/utf16beucs2codecvt.cpp index 747511c9..082376b3 100644 --- a/src/convert/utf16beucs2codecvt.cpp +++ b/src/convert/utf16beucs2codecvt.cpp @@ -5,9 +5,6 @@ #ifndef ARABICA_NO_WCHAR_T #include -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif //--------------------------------------------------------------------------- using namespace Arabica::convert; diff --git a/src/convert/utf16leucs2codecvt.cpp b/src/convert/utf16leucs2codecvt.cpp index 1ba57fc1..de0e8dbd 100644 --- a/src/convert/utf16leucs2codecvt.cpp +++ b/src/convert/utf16leucs2codecvt.cpp @@ -5,9 +5,6 @@ #ifndef ARABICA_NO_WCHAR_T #include -#ifdef ARABICA_VS6_WORKAROUND -#include -#endif using namespace Arabica::convert;