mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-18 22:26:32 +01:00
Visual Studio 6 hasn't been a build target for some time now. Removed the left over bits of VS6 specific workarounds.
This commit is contained in:
parent
812925e669
commit
b08e5f8ab5
20 changed files with 2 additions and 153 deletions
|
@ -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
|
||||
|
|
|
@ -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<typename T>
|
||||
T max(T a, T b)
|
||||
{
|
||||
return (a > b) ? a : b;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T min(T a, T b)
|
||||
{
|
||||
return (a < b) ? a : b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -514,11 +514,7 @@ bool expat_wrapper<string_type, T0, T1>::do_parse(inputSourceT& source, XML_Pars
|
|||
} // do_parse
|
||||
|
||||
template<class string_type, class T0, class T1>
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
std::auto_ptr<typename expat_wrapper<string_type, T0, T1>::PropertyBaseT> expat_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
|
||||
#else
|
||||
std::auto_ptr<expat_wrapper<string_type, T0, T1>::PropertyBaseT> expat_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
|
||||
#endif
|
||||
{
|
||||
if(name == properties_.lexicalHandler)
|
||||
{
|
||||
|
|
|
@ -333,11 +333,7 @@ void libxml2_wrapper<string_type, T0, T1>::setFeature(const string_type& name, b
|
|||
} // setFeature
|
||||
|
||||
template<class string_type, class T0, class T1>
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
std::auto_ptr<typename libxml2_wrapper<string_type, T0, T1>::PropertyBaseT> libxml2_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
|
||||
#else
|
||||
std::auto_ptr<libxml2_wrapper<string_type, T0, T1>::PropertyBaseT> libxml2_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
|
||||
#endif
|
||||
{
|
||||
if(name == properties_.declHandler)
|
||||
{
|
||||
|
|
|
@ -934,31 +934,19 @@ void xerces_wrapper<string_type, T0, T1>::setFeature(const string_type& name, bo
|
|||
} // setFeature
|
||||
|
||||
template<class string_type, class T0, class T1>
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
std::auto_ptr<typename xerces_wrapper<string_type, T0, T1>::XMLReaderT::PropertyBase> xerces_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
|
||||
#else
|
||||
std::auto_ptr<xerces_wrapper<string_type, T0, T1>::XMLReaderT::PropertyBase> xerces_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
|
||||
#endif
|
||||
{
|
||||
if(name == properties_.lexicalHandler)
|
||||
{
|
||||
typedef typename XMLReaderT::template Property<LexicalHandlerT *> Prop;
|
||||
Prop *prop = new Prop(lexicalHandlerAdaptor_.getLexicalHandler());
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
return std::auto_ptr<typename XMLReaderT::PropertyBase>(prop);
|
||||
#else
|
||||
return std::auto_ptr<XMLReaderT::PropertyBase>(prop);
|
||||
#endif
|
||||
}
|
||||
if(name == properties_.declHandler)
|
||||
{
|
||||
typedef typename XMLReaderT::template Property<DeclHandlerT*> Prop;
|
||||
Prop* prop = new Prop(declHandlerAdaptor_.getDeclHandler());
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
return std::auto_ptr<typename XMLReaderT::PropertyBase>(prop);
|
||||
#else
|
||||
return std::auto_ptr<XMLReaderT::PropertyBase>(prop);
|
||||
#endif
|
||||
}
|
||||
if (name == properties_.externalSchemaLocation)
|
||||
{
|
||||
|
@ -969,11 +957,7 @@ std::auto_ptr<typename xerces_wrapper<string_type, T0, T1>::XMLReaderT::Property
|
|||
XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchemaExternalSchemaLocation));
|
||||
|
||||
externalSchemaLocation_ = XSA::makeStringT(xercesExternalSchemaLocation);
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
std::auto_ptr<typename XMLReaderT::PropertyBase> toReturn(new StringPropertyType(externalSchemaLocation_));
|
||||
#else
|
||||
std::auto_ptr<XMLReaderT::PropertyBase> toReturn(new StringPropertyType(externalSchemaLocation_));
|
||||
#endif
|
||||
#ifdef SAXXERCES_DEBUG
|
||||
std::cerr << "Returning " << typeid(toReturn)
|
||||
<< "(*(" << typeid(*toReturn.get()) << ")"
|
||||
|
@ -992,21 +976,13 @@ std::auto_ptr<typename xerces_wrapper<string_type, T0, T1>::XMLReaderT::Property
|
|||
XERCES_CPP_NAMESPACE::XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation));
|
||||
|
||||
externalNoNamespaceSchemaLocation_ = XSA::makeStringT(xercesExternalNoNamespaceSchemaLocation);
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
return std::auto_ptr<typename XMLReaderT::PropertyBase>(new StringPropertyType(externalNoNamespaceSchemaLocation_));
|
||||
#else
|
||||
return std::auto_ptr<XMLReaderT::PropertyBase>(new StringPropertyType(externalNoNamespaceSchemaLocation_));
|
||||
#endif
|
||||
}
|
||||
throw SAX::SAXNotRecognizedException("Property not recognized ");
|
||||
} // doGetProperty
|
||||
|
||||
template<class string_type, class T0, class T1>
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
void xerces_wrapper<string_type, T0, T1>::doSetProperty(const string_type& name, std::auto_ptr<typename XMLReaderT::PropertyBase> value)
|
||||
#else
|
||||
void xerces_wrapper<string_type, T0, T1>::doSetProperty(const string_type& name, std::auto_ptr<XMLReaderT::PropertyBase> value)
|
||||
#endif
|
||||
{
|
||||
if(name == properties_.lexicalHandler)
|
||||
{
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
#include <SAX/ArabicaConfig.hpp>
|
||||
#include <Arabica/mbstate.hpp>
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace convert
|
||||
|
|
|
@ -4,12 +4,6 @@
|
|||
#include <SAX/ArabicaConfig.hpp>
|
||||
#include <Arabica/mbstate.hpp>
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
namespace std {
|
||||
typedef ::mbstate_t mbstate_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace convert
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
#include <locale>
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
#include <Arabica/mbstate.hpp>
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
|
|
|
@ -18,10 +18,6 @@
|
|||
#include <convert/impl/codecvt_specialisations.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace convert
|
||||
|
|
|
@ -16,10 +16,6 @@
|
|||
#include <convert/impl/codecvt_specialisations.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace convert
|
||||
|
|
|
@ -16,10 +16,6 @@
|
|||
#include <convert/impl/codecvt_specialisations.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace convert
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
#include <convert/impl/codecvt_specialisations.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace convert
|
||||
|
|
|
@ -4,12 +4,6 @@
|
|||
#include <SAX/ArabicaConfig.hpp>
|
||||
#include <Arabica/mbstate.hpp>
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
namespace std {
|
||||
typedef ::mbstate_t mbstate_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace convert
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
#include <convert/impl/codecvt_specialisations.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace convert
|
||||
|
|
|
@ -22,9 +22,6 @@
|
|||
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
#include <Arabica/mbstate.hpp>
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
|
@ -147,11 +144,7 @@ bool convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::flushOu
|
|||
|
||||
bool ok(true);
|
||||
const std::codecvt<charT, externalCharT, state_t>& cvt =
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
std::use_facet<std::codecvt<charT, externalCharT, std::mbstate_t> >(this->getloc());
|
||||
#else
|
||||
std::use_facet(this->getloc(), (std::codecvt<charT, externalCharT, std::mbstate_t>*)0, true);
|
||||
#endif
|
||||
|
||||
if(cvt.always_noconv())
|
||||
std::copy(&outBuffer_[0], &outBuffer_[0] + length, std::ostreambuf_iterator<externalCharT>(externalbuf_));
|
||||
|
@ -199,11 +192,7 @@ std::streamsize convert_bufadaptor<charT, traitsT, externalCharT, externalTraits
|
|||
pbCount*sizeof(charT));
|
||||
|
||||
const std::codecvt<charT, externalCharT, state_t>& cvt =
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
std::use_facet<std::codecvt<charT, externalCharT, std::mbstate_t> >(this->getloc());
|
||||
#else
|
||||
std::use_facet(this->getloc(), (std::codecvt<charT, externalCharT, std::mbstate_t>*)0, true);
|
||||
#endif
|
||||
std::use_facet<std::codecvt<charT, externalCharT, std::mbstate_t> >(this->getloc());
|
||||
|
||||
externalCharT from[1024];
|
||||
|
||||
|
|
|
@ -122,13 +122,8 @@ public:
|
|||
void str(const fromStringT& str)
|
||||
{
|
||||
// do conversion
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
const std::codecvt<charT, fromCharT, typename traitsT::state_type>& cvt =
|
||||
std::use_facet<std::codecvt<charT, fromCharT, typename traitsT::state_type> >(this->getloc());
|
||||
#else
|
||||
const std::codecvt<charT, fromCharT, traitsT::state_type>& cvt =
|
||||
std::use_facet(convertstreambuf_initT::buf()->getloc(), (std::codecvt<charT, fromCharT, traitsT::state_type>*)0, true);
|
||||
#endif
|
||||
|
||||
if(cvt.always_noconv())
|
||||
{
|
||||
|
@ -165,14 +160,9 @@ private:
|
|||
{
|
||||
stringT dest;
|
||||
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
std::back_insert_iterator<stringT> id(dest);
|
||||
for(typename fromStringT::const_iterator i = str.begin(); i != str.end(); ++i, ++id)
|
||||
*id = static_cast<charT>(*i);
|
||||
#else
|
||||
for(typename fromStringT::const_iterator i = str.begin(); i != str.end(); ++i)
|
||||
dest += static_cast<charT>(*i);
|
||||
#endif
|
||||
|
||||
return dest;
|
||||
} // no_conversion
|
||||
|
@ -226,13 +216,8 @@ public:
|
|||
return out;
|
||||
|
||||
// convert it here
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
const std::codecvt<charT, toCharT, typename traitsT::state_type>& cvt =
|
||||
std::use_facet<std::codecvt<charT, toCharT, typename traitsT::state_type> >(this->getloc());
|
||||
#else
|
||||
const std::codecvt<charT, toCharT, traitsT::state_type>& cvt =
|
||||
std::use_facet(getloc(), (std::codecvt<charT, toCharT, traitsT::state_type>*)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<toStringT> id(dest);
|
||||
std::back_insert_iterator<toStringT> id(dest);
|
||||
for(typename stringT::const_iterator i = str.begin(); i != str.end(); ++i, ++id)
|
||||
*id = static_cast<toCharT>(*i);
|
||||
#else
|
||||
for(typename stringT::const_iterator i = str.begin(); i != str.end(); ++i)
|
||||
dest += static_cast<toCharT>(*i);
|
||||
#endif
|
||||
|
||||
return dest;
|
||||
} // no_conversion
|
||||
|
|
|
@ -33,10 +33,6 @@
|
|||
# define INADDR_NONE ((in_addr_t) -1)
|
||||
#endif
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
namespace Arabica
|
||||
{
|
||||
namespace io
|
||||
|
@ -50,7 +46,6 @@ class basic_socketbuf : public std::basic_streambuf<charT, traitsT>
|
|||
public:
|
||||
typedef typename traitsT::int_type int_type;
|
||||
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
using std::basic_streambuf<charT, traitsT>::setp;
|
||||
using std::basic_streambuf<charT, traitsT>::setg;
|
||||
using std::basic_streambuf<charT, traitsT>::underflow;
|
||||
|
@ -59,7 +54,6 @@ class basic_socketbuf : public std::basic_streambuf<charT, traitsT>
|
|||
using std::basic_streambuf<charT, traitsT>::egptr;
|
||||
using std::basic_streambuf<charT, traitsT>::eback;
|
||||
using std::basic_streambuf<charT, traitsT>::pptr;
|
||||
#endif
|
||||
|
||||
basic_socketbuf();
|
||||
virtual ~basic_socketbuf();
|
||||
|
@ -358,10 +352,8 @@ class basic_socketstream :
|
|||
public std::basic_iostream<charT, traitsT>
|
||||
{
|
||||
public:
|
||||
#ifndef ARABICA_VS6_WORKAROUND
|
||||
using std::basic_iostream<charT, traitsT>::setstate;
|
||||
using std::basic_iostream<charT, traitsT>::badbit;
|
||||
#endif
|
||||
|
||||
basic_socketstream();
|
||||
explicit basic_socketstream(const char* hostname, int port);
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
///////////////////////////////////////////
|
||||
|
||||
#include <convert/rot13codecvt.hpp>
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
using namespace Arabica::convert;
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
#ifndef ARABICA_NO_WCHAR_T
|
||||
#include <convert/impl/ucs2_utf16.hpp>
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
//---------------------------------------------------------------------------
|
||||
using namespace Arabica::convert;
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
#ifndef ARABICA_NO_WCHAR_T
|
||||
#include <convert/impl/ucs2_utf16.hpp>
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
||||
using namespace Arabica::convert;
|
||||
|
||||
|
|
Loading…
Reference in a new issue