Re: libxml2 2.9.8 build error on AIX, HP-UX and old Visual Studio like 10.0
Nick Wellnhofer <[email protected]>
| Newsgroups | gmane.comp.gnome.lib.xml.general |
|---|---|
| Message-ID | <[email protected]> |
On 15/03/2018 15:50, Fabrice Manfroi wrote: > ..\xpath.c(506) : error C2099: initializer is not a constant Does the attached patch work for you? Nick _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] https://mail.gnome.org/mailman/listinfo/xml
non-const-nan.patch
(text/plain, 557 B)
diff --git a/xpath.c b/xpath.c
index f4406967..773e848b 100644
--- a/xpath.c
+++ b/xpath.c
@@ -485,9 +485,9 @@ int wrap_cmp( xmlNodePtr x, xmlNodePtr y );
#define INFINITY HUGE_VAL
#endif
-double xmlXPathNAN = NAN;
-double xmlXPathPINF = INFINITY;
-double xmlXPathNINF = -INFINITY;
+double xmlXPathNAN;
+double xmlXPathPINF;
+double xmlXPathNINF;
/**
* xmlXPathInit:
@@ -498,6 +498,9 @@ double xmlXPathNINF = -INFINITY;
*/
void
xmlXPathInit(void) {
+ xmlXPathNAN = NAN;
+ xmlXPathPINF = INFINITY;
+ xmlXPathNINF = -INFINITY;
}
/**