You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Trevor Smigiel <ts...@cup.hp.com> on 2000/10/10 01:55:04 UTC

Porting Xalan to HP-UX 11.00.

Hi,

I am trying to port xalan to HP-UX 11.00 using aCC.  The majority of
changes I've needed to make are trivial, e.g. different header names.
I've run into a problem with DOMStringHelper.cpp and wchar_t.

For a number of the functions in DOMStringHelper.cpp, aCC (the HP C++
compiler) complains about type mismatches.  For example here is one of
the functions and the error I get (I do not define
XALAN_USE_WCHAR_SUPPORT, so I've removed that code from this example)

XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(XalanDOMString)
LongToHexDOMString(long         theLong)
{
        char            theBuffer[MAX_PRINTF_DIGITS + 1];

        ostrstream      theFormatter(theBuffer, sizeof(theBuffer));

        theFormatter << hex << theLong << '\0';

        // We don't need to transcode, so just make it a
        // wide character string...
        wchar_t         theResult[MAX_PRINTF_DIGITS + 1];

        const unsigned int      theLength = length(theBuffer);
        copy(theBuffer, theBuffer + theLength, theResult);
        return XalanDOMString(theResult, theLength);
}

Error 226: "PlatformSupport/DOMStringHelper.cpp", line 1401 # No appropriate function
    found for call of 'DOMString::DOMString'. Last viable candidate was
    "DOMString::DOMString(const unsigned short *,unsigned int)"
    ["/disk3/xml/xml-xerces/c/src/dom/DOMString.hpp", line 167]. Argument of type
    'wchar_t [101]' could not be converted to 'const unsigned short *'.
            return XalanDOMString(theResult, theLength);

Does the variable 'theResult' need to be of type wchar_t?  Does some
kind of translation potentially happen during the 'copy' because
'theResult' is of type wchar_t?  Would it be correct to use
'XalanDOMChar' instead of 'wchar_t' here?

I am building from the latest sources from CVS, with the expectation
that the changes I need for HP-UX can be merged into the official
sources.  Will it be easy for me to get these changes merged?

Thanks,
Trevor