You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Peter Murphy <pe...@fast.fujitsu.com.au> on 2001/02/20 00:58:23 UTC
Problem with XalanDOMException.
Xalan developers,
I'm developing an application that uses Xalan C++ 1.0. It also uses some
proprietry header file to interact with a database. I cannot change these
files, not can I un#include (sic?) them. It contains the line:
#define UNKNOWN 0
Unfortunately, when I tried to compile, I found this word clashes with the
use of "UNKNOWN" in XalanDOMException.hpp.
----------------------------------------------------------------------------
--------
class XALAN_DOM_EXPORT XalanDOMException
{
public:
/** @name Enumerators for DOM Exceptions */
//@{
enum ExceptionCode
{
[...]
// This is the first available number,
// according to the spec.
UNKNOWN = 201
};
//@}
------------------------------
In Xalan, I changed all instances of UNKNOWN to EXCEPT_UNKNOWN. There were
four instances: two in XalanDOMException.hpp, one in XercesDOMException.hpp,
and one in XercesDOMException.cpp. This solved the problem; I can now
compile my application.
Would it be possible to integrate these changes into Xalan? "Unknown" is a
common word, and other developers may have innocently used the word as a
macro in their header files. The clashes that happened to me could happen to
other people using other products and interfaces. Using an unusual name like
"EXCEPT_UNKNOWN" could prevent such clashes in the future.
I attached the changed files as a ZIP.
Regards,
Peter.