Here are some changes I had to make to compile XALAN-C++ 1.2 on Linux
(Redhat 6.2 and Redhat 7.1) with g++-2.95.2 and 2.96 (I had to compile
it with *both* versions).

   The first two changes are only necessary if you want to compile
   *without* the NDEBUG flag set.

   The first one only exists because of a bug in g++-2.95.2 which cannot
   parse the double cast in an old-style c form.  I did not test it in 2.96
---edit XalanDOM/XalanDOMString.hpp: 1113 (insert a static_cast<> as follows:)
        assert(real_size_type(size_type(theSize)) == theSize);
---should change to
        assert(real_size_type(static_cast<size_type>(theSize)) == theSize);
---

The second problem is that a header file is not specified.
---edit TestXSLT/process.cpp: 73 (#include <typeinfo> if !defined(NDEBUG) )


#if !defined(NDEBUG) && defined(_MSC_VER)
#include <crtdbg.h>
#endif

---should change to (note blank lines removed to leave the linecounts unchanged)
#if !defined(NDEBUG) && defined(_MSC_VER)
#include <crtdbg.h>
#endif
#if !defined(NDEBUG)
#include <typeinfo>
#endif
---

   The error handler has a bug that crashes any program running the library
   if any of a certain set of errors comes up.  To prevent a crash:
---edit XSLT/XSLTEngineImpl.cpp: line 1280 from
        if (locator == 0)
---to a version that checks to prevent a segfault if styleNode is NULL
        if (locator == 0 && styleNode != 0)
---

   For g++ 2.95.2, -instances=static seems to be ignored, but in 2.96, it
   causes an error, so for Linux builds (especially with g++ 2.96):
--- change this line in the Linux options of Makefile
PLATFORM_COMPILE_OPTIONS = -fpic -Wall -instances=static -D${PLATFORM} -D_REENTRANT
--- to this without the -instances=static option
PLATFORM_COMPILE_OPTIONS = -fpic -Wall -D${PLATFORM} -D_REENTRANT
---

Reply via email to