diff --git a/SAX/ParserConfig.tpl b/SAX/ParserConfig.tpl new file mode 100644 index 00000000..a8bfbcb7 --- /dev/null +++ b/SAX/ParserConfig.tpl @@ -0,0 +1,71 @@ +#define pasty(m, n) m##n +#define include pasty(#, include) +#define ifdef pasty(#, ifdef) +#define ifndef pasty(#, ifndef) +#define endif pasty(#, endif) +#define define pasty(#, define) +#define message pasty(#, pragma message) +#define undef pasty(#, undef) +#define error pasty(#, error) +#define else pasty(#, else) +#define comment pasty(#, pragma comment) + + +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 +comment(lib, "libxml2.lib") +#endif +#endif +#ifdef USE_MSXML +message("Including MSXML") +include +undef DEF_SAX_P +define DEF_SAX_P msxml2_wrapper +#endif +#ifdef USE_XERCES +pragma message("Including Xerces") +include +undef DEF_SAX_P +define DEF_SAX_P xerces_wrapper +#ifdef _MSC_VER +comment(lib, "xerces-c_1.lib") +#endif +#endif +#ifdef USE_GARDEN +message("Including Garden") +include +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 +comment(lib, "expat.lib") +#endif +#endif + +ifndef NO_DEFAULT_PARSER +ifdef DEF_SAX_P +namespace SAX +{ + template + class XMLReader : public DEF_SAX_P { }; +} // namespace SAX +else +error "No default parser defined." +endif +endif + +undef DEF_P + +endif // ParserConfig_h \ No newline at end of file diff --git a/SAX/SAX.dsp b/SAX/SAX.dsp index 9978edfa..1d425696 100644 --- a/SAX/SAX.dsp +++ b/SAX/SAX.dsp @@ -129,6 +129,10 @@ SOURCE=.\Parser.h # End Source File # Begin Source File +SOURCE=.\ParserConfig.h +# End Source File +# Begin Source File + SOURCE=.\SAXException.h # End Source File # Begin Source File @@ -313,6 +317,26 @@ SOURCE=.\parsers\saxgarden.h # End Group # Begin Source File +SOURCE=.\ParserConfig.tpl + +!IF "$(CFG)" == "SAXlib - Win32 Release" + +!ELSEIF "$(CFG)" == "SAXlib - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build +InputPath=.\ParserConfig.tpl + +"ParserConfig.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + cl /TC /D USE_EXPAT /EP ParserConfig.tpl > ParserConfig.h + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\saxlib.cpp # End Source File # End Target