From 80a16c347cbd4d0b202a04dbe7b3e681191b12c9 Mon Sep 17 00:00:00 2001 From: jez_higgins <> Date: Tue, 9 Sep 2003 09:25:42 +0000 Subject: [PATCH] Tweaks to build with gcc 3.2.3 on Linux --- SAX/ParserConfig.S | 15 ++++++++++----- SAX/saxlib.S | 16 +++++++++++++--- Utils/convert_adaptor.h | 19 ++++++++++--------- examples/Makefile | 2 ++ examples/SAX/Makefile | 1 + examples/SAX2DOM/Makefile | 4 ++-- 6 files changed, 38 insertions(+), 19 deletions(-) diff --git a/SAX/ParserConfig.S b/SAX/ParserConfig.S index c1d758d1..d9c24167 100644 --- a/SAX/ParserConfig.S +++ b/SAX/ParserConfig.S @@ -15,35 +15,38 @@ ifndef ParserConfig_h define ParserConfig_h #ifdef USE_LIBXML2 -message("Including libxml2") include 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 undef DEF_SAX_P define DEF_SAX_P msxml2_wrapper #endif #ifdef USE_XERCES1 -message("Including Xerces 1") include 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 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 undef DEF_SAX_P define DEF_SAX_P expat_wrapper #ifdef _MSC_VER +message("Including Expat") comment(lib, "libexpat.lib") #endif #endif @@ -77,4 +80,6 @@ endif undef DEF_P -endif // ParserConfig_h \ No newline at end of file +endif // ParserConfig_h + + diff --git a/SAX/saxlib.S b/SAX/saxlib.S index 0d4afa58..4e9a92ac 100644 --- a/SAX/saxlib.S +++ b/SAX/saxlib.S @@ -19,8 +19,10 @@ define NO_DEFAULT_PARSER include #ifdef USE_LIBXML2 -message("Pulling in libxml2 wrappers.") include +#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 +#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 +#ifdef _MSC_VER +message("Pulling in Expat wrappers.") +#endif #endif + + + + diff --git a/Utils/convert_adaptor.h b/Utils/convert_adaptor.h index 4015c268..a075b3ee 100644 --- a/Utils/convert_adaptor.h +++ b/Utils/convert_adaptor.h @@ -19,7 +19,8 @@ #include #include #include -#if!(_MSC_VER < 1300) + +#if defined(_MSC_VER) && (_MSC_VER < 1300) #include #endif @@ -69,7 +70,7 @@ const std::streamsize convert_bufadaptor -convert_bufadaptor::int_type convert_bufadaptor::overflow(convert_bufadaptor::int_type c) +typename convert_bufadaptor::int_type convert_bufadaptor::overflow(int_type c) { if(traitsT::eq_int_type(traitsT::eof(), c)) return traitsT::not_eof(c); @@ -87,7 +88,7 @@ int convert_bufadaptor::sync() } // sync template -convert_bufadaptor::int_type convert_bufadaptor::underflow() +typename convert_bufadaptor::int_type convert_bufadaptor::underflow() { if(gptr() != 0 && gptr() < egptr()) return (traitsT::to_int_type(*gptr())); @@ -99,7 +100,7 @@ convert_bufadaptor::int_type con } // underflow template -convert_bufadaptor::int_type convert_bufadaptor::pbackfail(int_type c) +typename convert_bufadaptor::int_type convert_bufadaptor::pbackfail(int_type c) { if(gptr() == eback()) return traitsT::eof(); @@ -136,10 +137,10 @@ bool convert_bufadaptor::flushOu bool ok(true); const std::codecvt& cvt = -#if!(_MSC_VER < 1300) +#if !defined(_MSC_VER) || (_MSC_VER > 1300) std::use_facet >(this->getloc()); #else - std::use_facet(this->getloc(), (std::codecvt*)0, true); + std::use_facet(this->getloc(), (std::codecvt*)0, true); #endif if(cvt.always_noconv()) @@ -182,7 +183,7 @@ std::streamsize convert_bufadaptor 1300) size_t pbCount = std::min(gptr() - eback(), pbSize_); #else size_t pbCount = min(gptr() - eback(), pbSize_); @@ -192,10 +193,10 @@ std::streamsize convert_bufadaptor& cvt = -#if!(_MSC_VER < 1300) +#if !defined(_MSC_VER) || (_MSC_VER > 1300) std::use_facet >(this->getloc()); #else - std::use_facet(this->getloc(), (std::codecvt*)0, true); + std::use_facet(this->getloc(), (std::codecvt*)0, true); #endif std::vector from(inBuffer_.capacity()); diff --git a/examples/Makefile b/examples/Makefile index 66cefd60..3eb93aa0 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -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 #///////////////////////////////////////////////////////////////////////// diff --git a/examples/SAX/Makefile b/examples/SAX/Makefile index ad8cba20..9f506d5c 100644 --- a/examples/SAX/Makefile +++ b/examples/SAX/Makefile @@ -56,6 +56,7 @@ STATIC_LIBS = DYNAMIC_LIBS = -lArabica -lexpat CXXFLAGS += ${INCS_DIRS} +LDFLAGS += ${LIBS_DIRS} LDFLAGS += ${DYNAMIC_LIBS} #///////////////////////////////////////////////////////////////////////// diff --git a/examples/SAX2DOM/Makefile b/examples/SAX2DOM/Makefile index 603978f2..46788b8e 100644 --- a/examples/SAX2DOM/Makefile +++ b/examples/SAX2DOM/Makefile @@ -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 #/////////////////////////////////////////////////////////////////////////