[libxml2] Work around buggy ceil() function on AIX
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Work around buggy ceil() function on AIX
- Date: Fri, 2 Aug 2019 11:34:30 +0000 (UTC)
commit b17e3d1c2b6a6d4f3d365faa9908d2c91ca32420
Author: Daniel Richard G <skunk iSKUNK ORG>
Date: Thu Aug 1 15:04:16 2019 +0200
Work around buggy ceil() function on AIX
AIX has a buggy ceil() function that does not handle negative-zero
correctly.
Closes #79.
xpath.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/xpath.c b/xpath.c
index 4734ecc4..65a9f09e 100644
--- a/xpath.c
+++ b/xpath.c
@@ -9584,7 +9584,12 @@ xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs) {
CAST_TO_NUMBER;
CHECK_TYPE(XPATH_NUMBER);
+#ifdef _AIX
+ /* Work around buggy ceil() function on AIX */
+ ctxt->value->floatval = copysign(ceil(ctxt->value->floatval), ctxt->value->floatval);
+#else
ctxt->value->floatval = ceil(ctxt->value->floatval);
+#endif
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]