Tweaks to build with gcc 3.2.3 on Linux

This commit is contained in:
jez_higgins 2003-09-09 09:25:42 +00:00
parent 022a87711d
commit 80a16c347c
6 changed files with 38 additions and 19 deletions

View file

@ -15,35 +15,38 @@ ifndef ParserConfig_h
define ParserConfig_h define ParserConfig_h
#ifdef USE_LIBXML2 #ifdef USE_LIBXML2
message("Including libxml2")
include <SAX/wrappers/saxlibxml2.h> include <SAX/wrappers/saxlibxml2.h>
undef DEF_SAX_P undef DEF_SAX_P
define DEF_SAX_P libxml2_wrapper define DEF_SAX_P libxml2_wrapper
#ifdef _MSC_VER #ifdef _MSC_VER
message("Including libxml2")
comment(lib, "libxml2.lib") comment(lib, "libxml2.lib")
#endif #endif
#endif #endif
#ifdef USE_MSXML #ifdef USE_MSXML
#ifndef _MSC_VER
error "Can only use MSXML on Windows"
#endif
message("Including MSXML") message("Including MSXML")
include <SAX/wrappers/saxmsxml2.h> include <SAX/wrappers/saxmsxml2.h>
undef DEF_SAX_P undef DEF_SAX_P
define DEF_SAX_P msxml2_wrapper define DEF_SAX_P msxml2_wrapper
#endif #endif
#ifdef USE_XERCES1 #ifdef USE_XERCES1
message("Including Xerces 1")
include <SAX/wrappers/saxxerces.h> include <SAX/wrappers/saxxerces.h>
undef DEF_SAX_P undef DEF_SAX_P
define DEF_SAX_P xerces_wrapper define DEF_SAX_P xerces_wrapper
#ifdef _MSC_VER #ifdef _MSC_VER
message("Including Xerces 1")
comment(lib, "xerces-c_1.lib") comment(lib, "xerces-c_1.lib")
#endif #endif
#endif #endif
#ifdef USE_XERCES #ifdef USE_XERCES
message("Including Xerces")
include <SAX/wrappers/saxxerces.h> include <SAX/wrappers/saxxerces.h>
undef DEF_SAX_P undef DEF_SAX_P
define DEF_SAX_P xerces_wrapper define DEF_SAX_P xerces_wrapper
#ifdef _MSC_VER #ifdef _MSC_VER
message("Including Xerces")
comment(lib, "xerces-c_2.lib") comment(lib, "xerces-c_2.lib")
#endif #endif
#endif #endif
@ -54,11 +57,11 @@ undef DEF_SAX_P
define DEF_SAX_P Garden define DEF_SAX_P Garden
#endif #endif
#ifdef USE_EXPAT #ifdef USE_EXPAT
message("Including Expat")
include <SAX/wrappers/saxexpat.h> include <SAX/wrappers/saxexpat.h>
undef DEF_SAX_P undef DEF_SAX_P
define DEF_SAX_P expat_wrapper define DEF_SAX_P expat_wrapper
#ifdef _MSC_VER #ifdef _MSC_VER
message("Including Expat")
comment(lib, "libexpat.lib") comment(lib, "libexpat.lib")
#endif #endif
#endif #endif
@ -78,3 +81,5 @@ endif
undef DEF_P undef DEF_P
endif // ParserConfig_h endif // ParserConfig_h

View file

@ -19,8 +19,10 @@ define NO_DEFAULT_PARSER
include <SAX/XMLReader.h> include <SAX/XMLReader.h>
#ifdef USE_LIBXML2 #ifdef USE_LIBXML2
message("Pulling in libxml2 wrappers.")
include <SAX/wrappers/saxlibxml2.cpp> include <SAX/wrappers/saxlibxml2.cpp>
#ifdef _MSC_VER
message("Pulling in libxml2 wrappers.")
#endif
#endif #endif
#ifdef USE_MSXML #ifdef USE_MSXML
@ -32,8 +34,10 @@ message("Nothing to pull in for MSXML.")
#endif #endif
#ifdef USE_XERCES #ifdef USE_XERCES
message("Pulling in Xerces wrappers.")
include <SAX/wrappers/saxxerces.cpp> include <SAX/wrappers/saxxerces.cpp>
#ifdef _MSC_VER
message("Pulling in Xerces wrappers.")
#endif
#endif #endif
#ifdef USE_GARDEN #ifdef USE_GARDEN
@ -41,6 +45,12 @@ message("Nothing to pull in for Garden.")
#endif #endif
#ifdef USE_EXPAT #ifdef USE_EXPAT
message("Pulling in Expat wrappers.")
include <SAX/wrappers/saxexpat.cpp> include <SAX/wrappers/saxexpat.cpp>
#ifdef _MSC_VER
message("Pulling in Expat wrappers.")
#endif #endif
#endif

View file

@ -19,7 +19,8 @@
#include <ostream> #include <ostream>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#if!(_MSC_VER < 1300)
#if defined(_MSC_VER) && (_MSC_VER < 1300)
#include <minmax.h> #include <minmax.h>
#endif #endif
@ -69,7 +70,7 @@ const std::streamsize convert_bufadaptor<charT, traitsT, externalCharT, external
// why 4? both Josuttis and Langer&Kreft use 4. // why 4? both Josuttis and Langer&Kreft use 4.
template<class charT, class traitsT, class externalCharT, class externalTraitsT> 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)) if(traitsT::eq_int_type(traitsT::eof(), c))
return traitsT::not_eof(c); return traitsT::not_eof(c);
@ -87,7 +88,7 @@ int convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::sync()
} // sync } // sync
template<class charT, class traitsT, class externalCharT, class externalTraitsT> 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()) if(gptr() != 0 && gptr() < egptr())
return (traitsT::to_int_type(*gptr())); return (traitsT::to_int_type(*gptr()));
@ -99,7 +100,7 @@ convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::int_type con
} // underflow } // underflow
template<class charT, class traitsT, class externalCharT, class externalTraitsT> 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()) if(gptr() == eback())
return traitsT::eof(); return traitsT::eof();
@ -136,10 +137,10 @@ bool convert_bufadaptor<charT, traitsT, externalCharT, externalTraitsT>::flushOu
bool ok(true); bool ok(true);
const std::codecvt<charT, char, state_t>& cvt = 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()); std::use_facet<std::codecvt<charT, char, typename traitsT::state_type> >(this->getloc());
#else #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 #endif
if(cvt.always_noconv()) if(cvt.always_noconv())
@ -182,7 +183,7 @@ std::streamsize convert_bufadaptor<charT, traitsT, externalCharT, externalTraits
if(!inBuffer_.capacity()) if(!inBuffer_.capacity())
growInBuffer(); growInBuffer();
#if!(_MSC_VER < 1300) #if !defined(_MSC_VER) || (_MSC_VER > 1300)
size_t pbCount = std::min<size_t>(gptr() - eback(), pbSize_); size_t pbCount = std::min<size_t>(gptr() - eback(), pbSize_);
#else #else
size_t pbCount = min(gptr() - eback(), pbSize_); size_t pbCount = min(gptr() - eback(), pbSize_);
@ -192,10 +193,10 @@ std::streamsize convert_bufadaptor<charT, traitsT, externalCharT, externalTraits
pbCount*sizeof(charT)); pbCount*sizeof(charT));
const std::codecvt<charT, char, state_t>& cvt = 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()); std::use_facet<std::codecvt<charT, char, typename traitsT::state_type> >(this->getloc());
#else #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 #endif
std::vector<externalCharT> from(inBuffer_.capacity()); std::vector<externalCharT> from(inBuffer_.capacity());

View file

@ -7,12 +7,14 @@
all : all :
cd SAX; ${MAKE} cd SAX; ${MAKE}
cd SAX2DOM; ${MAKE} cd SAX2DOM; ${MAKE}
cd Utils; ${MAKE}
# Cleaning up # Cleaning up
clean : clean :
cd SAX; ${MAKE} clean cd SAX; ${MAKE} clean
cd SAX2DOM; ${MAKE} clean cd SAX2DOM; ${MAKE} clean
cd Utils; ${MAKE} clean
#///////////////////////////////////////////////////////////////////////// #/////////////////////////////////////////////////////////////////////////

View file

@ -56,6 +56,7 @@ STATIC_LIBS =
DYNAMIC_LIBS = -lArabica -lexpat DYNAMIC_LIBS = -lArabica -lexpat
CXXFLAGS += ${INCS_DIRS} CXXFLAGS += ${INCS_DIRS}
LDFLAGS += ${LIBS_DIRS}
LDFLAGS += ${DYNAMIC_LIBS} LDFLAGS += ${DYNAMIC_LIBS}
#///////////////////////////////////////////////////////////////////////// #/////////////////////////////////////////////////////////////////////////

View file

@ -43,7 +43,7 @@ CXXFLAGS += -O2
LDFLAGS += -O2 -L../../bin LDFLAGS += -O2 -L../../bin
# Uncomment for debug version # Uncomment for debug version
CXXFLAGS += -g -D__DEBUG__ CXXFLAGS += -g
# Includes and library directories # Includes and library directories
@ -121,7 +121,7 @@ depend : .depend
# Cleaning up # Cleaning up
clean : 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
#///////////////////////////////////////////////////////////////////////// #/////////////////////////////////////////////////////////////////////////