mirror of
https://github.com/jezhiggins/arabica
synced 2024-12-27 21:58:30 +01:00
Tweaks to build with gcc 3.2.3 on Linux
This commit is contained in:
parent
022a87711d
commit
80a16c347c
6 changed files with 38 additions and 19 deletions
|
@ -15,35 +15,38 @@ ifndef ParserConfig_h
|
|||
define ParserConfig_h
|
||||
|
||||
#ifdef USE_LIBXML2
|
||||
message("Including libxml2")
|
||||
include <SAX/wrappers/saxlibxml2.h>
|
||||
undef DEF_SAX_P
|
||||
define DEF_SAX_P libxml2_wrapper
|
||||
#ifdef _MSC_VER
|
||||
message("Including libxml2")
|
||||
comment(lib, "libxml2.lib")
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_MSXML
|
||||
#ifndef _MSC_VER
|
||||
error "Can only use MSXML on Windows"
|
||||
#endif
|
||||
message("Including MSXML")
|
||||
include <SAX/wrappers/saxmsxml2.h>
|
||||
undef DEF_SAX_P
|
||||
define DEF_SAX_P msxml2_wrapper
|
||||
#endif
|
||||
#ifdef USE_XERCES1
|
||||
message("Including Xerces 1")
|
||||
include <SAX/wrappers/saxxerces.h>
|
||||
undef DEF_SAX_P
|
||||
define DEF_SAX_P xerces_wrapper
|
||||
#ifdef _MSC_VER
|
||||
message("Including Xerces 1")
|
||||
comment(lib, "xerces-c_1.lib")
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_XERCES
|
||||
message("Including Xerces")
|
||||
include <SAX/wrappers/saxxerces.h>
|
||||
undef DEF_SAX_P
|
||||
define DEF_SAX_P xerces_wrapper
|
||||
#ifdef _MSC_VER
|
||||
message("Including Xerces")
|
||||
comment(lib, "xerces-c_2.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
@ -54,11 +57,11 @@ undef DEF_SAX_P
|
|||
define DEF_SAX_P Garden
|
||||
#endif
|
||||
#ifdef USE_EXPAT
|
||||
message("Including Expat")
|
||||
include <SAX/wrappers/saxexpat.h>
|
||||
undef DEF_SAX_P
|
||||
define DEF_SAX_P expat_wrapper
|
||||
#ifdef _MSC_VER
|
||||
message("Including Expat")
|
||||
comment(lib, "libexpat.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
@ -78,3 +81,5 @@ endif
|
|||
undef DEF_P
|
||||
|
||||
endif // ParserConfig_h
|
||||
|
||||
|
||||
|
|
16
SAX/saxlib.S
16
SAX/saxlib.S
|
@ -19,8 +19,10 @@ define NO_DEFAULT_PARSER
|
|||
include <SAX/XMLReader.h>
|
||||
|
||||
#ifdef USE_LIBXML2
|
||||
message("Pulling in libxml2 wrappers.")
|
||||
include <SAX/wrappers/saxlibxml2.cpp>
|
||||
#ifdef _MSC_VER
|
||||
message("Pulling in libxml2 wrappers.")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_MSXML
|
||||
|
@ -32,8 +34,10 @@ message("Nothing to pull in for MSXML.")
|
|||
#endif
|
||||
|
||||
#ifdef USE_XERCES
|
||||
message("Pulling in Xerces wrappers.")
|
||||
include <SAX/wrappers/saxxerces.cpp>
|
||||
#ifdef _MSC_VER
|
||||
message("Pulling in Xerces wrappers.")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_GARDEN
|
||||
|
@ -41,6 +45,12 @@ message("Nothing to pull in for Garden.")
|
|||
#endif
|
||||
|
||||
#ifdef USE_EXPAT
|
||||
message("Pulling in Expat wrappers.")
|
||||
include <SAX/wrappers/saxexpat.cpp>
|
||||
#ifdef _MSC_VER
|
||||
message("Pulling in Expat wrappers.")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
#include <ostream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#if!(_MSC_VER < 1300)
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1300)
|
||||
#include <minmax.h>
|
||||
#endif
|
||||
|
||||
|
@ -69,7 +70,7 @@ const std::streamsize convert_bufadaptor<charT, traitsT, externalCharT, external
|
|||
// why 4? both Josuttis and Langer&Kreft use 4.
|
||||
|
||||
template<class charT, class traitsT, class externalCharT, class externalTraitsT>
|
||||
convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::overflow(convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type c)
|
||||
typename convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::overflow(int_type c)
|
||||
{
|
||||
if(traitsT::eq_int_type(traitsT::eof(), c))
|
||||
return traitsT::not_eof(c);
|
||||
|
@ -87,7 +88,7 @@ int convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::sync()
|
|||
} // sync
|
||||
|
||||
template<class charT, class traitsT, class externalCharT, class externalTraitsT>
|
||||
convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::underflow()
|
||||
typename convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::underflow()
|
||||
{
|
||||
if(gptr() != 0 && gptr() < egptr())
|
||||
return (traitsT::to_int_type(*gptr()));
|
||||
|
@ -99,7 +100,7 @@ convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type con
|
|||
} // underflow
|
||||
|
||||
template<class charT, class traitsT, class externalCharT, class externalTraitsT>
|
||||
convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::pbackfail(int_type c)
|
||||
typename convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::pbackfail(int_type c)
|
||||
{
|
||||
if(gptr() == eback())
|
||||
return traitsT::eof();
|
||||
|
@ -136,10 +137,10 @@ bool convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::flushOu
|
|||
|
||||
bool ok(true);
|
||||
const std::codecvt<charT, char, state_t>& cvt =
|
||||
#if!(_MSC_VER < 1300)
|
||||
#if !defined(_MSC_VER) || (_MSC_VER > 1300)
|
||||
std::use_facet<std::codecvt<charT, char, typename traitsT::state_type> >(this->getloc());
|
||||
#else
|
||||
std::use_facet(this->getloc(), (std::codecvt<charT, char, traitsT::state_type>*)0, true);
|
||||
std::use_facet(this->getloc(), (std::codecvt<charT, char, typename traitsT::state_type>*)0, true);
|
||||
#endif
|
||||
|
||||
if(cvt.always_noconv())
|
||||
|
@ -182,7 +183,7 @@ std::streamsize convert_bufadaptor<charT, traitsT, externalCharT, externalTraits
|
|||
if(!inBuffer_.capacity())
|
||||
growInBuffer();
|
||||
|
||||
#if!(_MSC_VER < 1300)
|
||||
#if !defined(_MSC_VER) || (_MSC_VER > 1300)
|
||||
size_t pbCount = std::min<size_t>(gptr() - eback(), pbSize_);
|
||||
#else
|
||||
size_t pbCount = min(gptr() - eback(), pbSize_);
|
||||
|
@ -192,10 +193,10 @@ std::streamsize convert_bufadaptor<charT, traitsT, externalCharT, externalTraits
|
|||
pbCount*sizeof(charT));
|
||||
|
||||
const std::codecvt<charT, char, state_t>& cvt =
|
||||
#if!(_MSC_VER < 1300)
|
||||
#if !defined(_MSC_VER) || (_MSC_VER > 1300)
|
||||
std::use_facet<std::codecvt<charT, char, typename traitsT::state_type> >(this->getloc());
|
||||
#else
|
||||
std::use_facet(this->getloc(), (std::codecvt<charT, char, traitsT::state_type>*)0, true);
|
||||
std::use_facet(this->getloc(), (std::codecvt<charT, char, typename traitsT::state_type>*)0, true);
|
||||
#endif
|
||||
|
||||
std::vector<externalCharT> from(inBuffer_.capacity());
|
||||
|
|
|
@ -7,12 +7,14 @@
|
|||
all :
|
||||
cd SAX; ${MAKE}
|
||||
cd SAX2DOM; ${MAKE}
|
||||
cd Utils; ${MAKE}
|
||||
|
||||
# Cleaning up
|
||||
|
||||
clean :
|
||||
cd SAX; ${MAKE} clean
|
||||
cd SAX2DOM; ${MAKE} clean
|
||||
cd Utils; ${MAKE} clean
|
||||
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -56,6 +56,7 @@ STATIC_LIBS =
|
|||
DYNAMIC_LIBS = -lArabica -lexpat
|
||||
|
||||
CXXFLAGS += ${INCS_DIRS}
|
||||
LDFLAGS += ${LIBS_DIRS}
|
||||
LDFLAGS += ${DYNAMIC_LIBS}
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -43,7 +43,7 @@ CXXFLAGS += -O2
|
|||
LDFLAGS += -O2 -L../../bin
|
||||
|
||||
# Uncomment for debug version
|
||||
CXXFLAGS += -g -D__DEBUG__
|
||||
CXXFLAGS += -g
|
||||
|
||||
|
||||
# Includes and library directories
|
||||
|
@ -121,7 +121,7 @@ depend : .depend
|
|||
# Cleaning up
|
||||
|
||||
clean :
|
||||
$(REMOVE) .depend $(CPPUNITUI_OBJS) $(CPPUNITFW_OBJS) $(SAXDOM_OBJS) core sax2dom_test ../../bin/sax2dom_test
|
||||
$(REMOVE) .depend $(CPPUNITUI_OBJS) $(CPPUNITFW_OBJS) $(SAXDOM_OBJS) core sax2dom_test domwriter ../../bin/sax2dom_test ../../bin/domwriter
|
||||
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue