Commit 68aaba69 authored by Roland Levillain's avatar Roland Levillain
Browse files

Fix the checking of the C++ ABI of libxerces-x.

	* build-aux/vcsn-xml.m4 (_VCSN_CHECK_XML): Fix the checking of the
	C++ ABI of libxerces-x.
	* doc/README.txt: Update (Xerces-C++ ABI).
parent b79e4ef9
2006-07-28 Roland Levillain <roland@lrde.epita.fr>
Fix the checking of the C++ ABI of libxerces-x.
* build-aux/vcsn-xml.m4 (_VCSN_CHECK_XML): Fix the checking of the
C++ ABI of libxerces-x.
* doc/README.txt: Update (Xerces-C++ ABI).
2006-07-28 Akim Demaille <akim@lrde.epita.fr>
minidist.
......
......@@ -71,19 +71,56 @@ int main() {
const char *foo = "foo";
using namespace xercesc;
XMLCh* bar = XMLString::transcode(foo);
}
/* Check libxerces-x C++ ABI.
When a C++ piece of Vaucanson, compiled with G++ 4.0, is linked
against libxerces-c, compiled with G++ 3.3 (which is the case
with Fink on Mac OS X Tiger (10.3) / Xcode 1.5), the linker
complains about undefined symbols of typeinfo's. (This is a
simplistic test, but this should be enough to check the C++ ABI).
*/
#include <iostream>
#include <xercesc/sax/InputSource.hpp>
#include <xercesc/util/BinInputStream.hpp>
// Taken from vaucanson/xml/ios.h{h,xx}.
namespace vcsn
{
namespace xml
{
class BinCxxInputStream : public xercesc::BinInputStream
{
private:
std::istream* _in;
unsigned int _pos;
public:
BinCxxInputStream(std::istream* in) : _in(in), _pos(0) { }
virtual unsigned int curPos() const;
virtual unsigned readBytes (XMLByte *const toFill,
const unsigned int maxToRead);
};
inline
unsigned
BinCxxInputStream::readBytes (XMLByte *const toFill,
const unsigned int maxToRead)
{
// istream::readsome does not seem to work on SunOS
unsigned s = _in->rdbuf()->sgetn((char *)toFill, maxToRead);
_pos += s;
return s;
}
/* Check libxerces-x C++ ABI.
When a C++ piece of Vaucanson, compiled with G++ 4.0, is linked
against libxerces-c, compiled with G++ 3.3 (which is the case
with Fink on Mac OS X Tiger (10.3) / Xcode 1.5), the linker
complains about undefined symbols of typeinfo's for the following
types. (This is a simplistic test, but this should be enough to
check the C++ ABI). */
xercesc_2_6::InputSource* is;
xercesc_2_6::DOMException* de;
xercesc_2_6::XMLException* xe;
xercesc_2_6::BinInputStream* bis;
inline
unsigned int
BinCxxInputStream::curPos() const
{
return _pos;
}
}
}
])],
[vcsn_cv_xerces_lib=yes])
......
......@@ -149,12 +149,6 @@ portability in the future.
.. _GNU C++ Compiler (GCC): http://gcc.gnu.org/
.. _ICC: http://www.intel.com/software/products/compilers/
A known bug in GCC 4.0.0 for MacOs is supported to make the code
compliant with this specific compiler version, but MacOs users are
encouraged to upgrade their compiler. They should also notice that
their platform allows to select their default compiler using
``gcc_select``. GCC 4.0 is preferred.
High verbose mode of the testing suites uses the AT&T dot format to
save automaton in a human readable file. Use Graphviz_ to visualize
these .dot files.
......@@ -166,6 +160,13 @@ If you want to use the XML I/O system, you will need the Apache
.. _Xerces-C++: http://xml.apache.org/xerces-c/
The C++ Application Binary Interface (ABI) of the Xerces-C++ library
must be the same as the C++ ABI of the compiler used to built
Vaucanson's XML I/O system. In particular, users of Fink or
DarwinPorts on MacOS should pay attention to the compiler that was
used to build their version of the Xerces-C++ library, as it might
differ from the one used to build Vaucanson.
Using Vaucanson
===============
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment