Hi!
I recently downloaded the source for Xerces 1.2.0 for use with a Borland C++
5.02 project I'm working on and I thought I would relate my experiences. I
did not use the makefiles or configuration scripts. It did not, of course,
compile first go. I'll go through each of the issues I encountered:
1) dom/DocumentImpl.cpp
-----------------------
BC complained about ambiguous operator precedence in
"DocumentImpl::isKidOK()". The compiler was treating these as an error. I
just added extra brackets:
1 << DOM_Node::ELEMENT_NODE ) |
became
( 1 << DOM_Node::ELEMENT_NODE ) |
and so on. Also in the same function:
return (kidOK[p] & 1<<ch) != 0;
became
return (kidOK[p] & ( 1<<ch )) != 0;
for the same reasons.
2) dom/DOMString.cpp
--------------------
BC complained that it couldn't initialise the static data members of the
DOMString class. I'm pretty sure this is a BC bug, but the workaround is
simple - the initialisations are moved to the top of the source file before
the data members are referred to in the code:
int DOMString::gLiveStringDataCount = 0;
int DOMString::gTotalStringDataCount = 0;
int DOMString::gLiveStringHandleCount = 0;
int DOMString::gTotalStringHandleCount = 0;
were all moved to the top. While this is a compiler bug workaround, I don't
see the relocation as causing any problems for any other compiler (unless,
of course, the other compilers have their own bugs :-).
3) internal/XMLReader.cpp
-------------------------
Exactly the same problem as in issue #2 above. XMLReader::fgCharsTable had
to be moved to the beginning of the source file.
4) util/Transcoders/Win32/Win32TransService.cpp
-----------------------------------------------
A comment in this file indicated that Borland's compilers don't support
::wcsupr but *do* support ::_wcsupr. One out of the five occurrences had
been changed and I had to fix up the other four.
::wcsupr( ... );
became
::_wcsupr( ... );
5) util/Transcoders/Win32/Win32TransService.[cpp|hpp]
-----------------------------------------------------
BC complained that the class CPMapEntry was not defined. That's because the
class was declared in the *CPP* file and just had a simple "class
CPMapEntry;" in the HPP file. I moved the entire "class CPMapEntry { ... };"
from the CPP file to the HPP file.
6) framework/XMLElementDecl.hpp (class XMLElementDecl)
framework/XMLRecognizer.hpp (class XMLRecognizer)
internal/XMLReader.hpp (class XMLReader)
util/PlatformUtils.hpp (class XMLPlatformUtils)
util/XMLUni.hpp (class XMLUni)
---------------------------------------------------
All these appeared in the header files like:
class XMLUTIL_EXPORT class-name-here
BC generated no errors building the library, but when linking against it
gave *lots* of the following error:
"Error: Symbol <symbol-here> marked as __import in <file-name-here> was
public"
I just commented out the "XMLUTIL_EXPORT" in the header files. This may be
related to the fact I was building a static library and not a dynamic one,
but as I now have the library working (all the samples work) I may not
investigate any further for a while.
Regards,
Andrew Gregory