[xml] Workaround for compiling 'trio.c' with HP C/iX compiler on MPE



Hello,

i doubt that this is overly interresting but anyway, here it goes:

The current C-compiler for MPE (HP C/iX) has a parser bug that terminates
compilation in an error state when it tries to resolve a macro that includes
the
*type* 'long double' (e.g.: va_arg(arp_pointer, long double) ).
The MPE platform doesn't support a few functions that are necessary for
libxml2,
therefore trio support has to be enabled. Since 'trio.c' uses the mentioned
combination of va_arg() with 'long double', the compilation of libxml2
breaks.
HP has confirmed the bug and suggested a simple workaround:
It's sufficient to define a 'long double'  constant in the questionable
source code,
somewhere before 'long double' is used in a macro.
Sounds funny, but it works!
So, the following midget-patch will enables the copilation of 'trio.c' on
MPE:

----------------------------------------------------------------------------
-------------------
669a670,675
/*
 * Need this to workaround a parser bug in HP C/iX compiler that fails
 * to resolves macro definitions that includes typ 'long double',
 * e.g: va_arg(arg_ptr, long double)
 */
static const long double ___dummy_long_double = 0;
----------------------------------------------------------------------------
-------------------

It's a diff against version 1.7 of 'trio.c', AFAIK the most recent version.
I don't know if it's worth to apply it, but i'm quite shure that it won't
break
anything on other platforms, so i've waived a platform specific 
'#ifdef _TARGET_MPEIX ...'




Mit freundlichen Gruessen - Kind regards
Markus Henke


 <<trio.diff>> 

Attachment: trio.diff
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]