There are some UNIX systems that have their own _ABS() define in the
system header files, so the redefinition of _ABS() in popt.c can cause
problems. I changed the define to be POPT_ABS(). Also, some systems
don't seem to have DBL_EPSILON, so I define that if it is missing.
See attached patch.
..wayne..
--- popt.c 8 Mar 2008 17:26:30 -0000 1.116
+++ popt.c 9 Mar 2008 03:48:43 -0000
@@ -18,6 +18,10 @@
#include "findme.h"
#include "poptint.h"
+#ifndef DBL_EPSILON
+#define DBL_EPSILON 2.2204460492503131e-16
+#endif
+
#ifdef MYDEBUG
/[EMAIL PROTECTED]@*/
int _popt_debug = 0;
@@ -1075,10 +1079,10 @@ int poptGetNextOpt(poptContext con)
if (poptArgType(opt) == POPT_ARG_DOUBLE) {
arg.doublep[0] = aDouble;
} else {
-#define _ABS(a) ((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a))
- if ((_ABS(aDouble) - FLT_MAX) > DBL_EPSILON)
+#define POPT_ABS(a) ((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a))
+ if ((POPT_ABS(aDouble) - FLT_MAX) > DBL_EPSILON)
return POPT_ERROR_OVERFLOW;
- if ((FLT_MIN - _ABS(aDouble)) > DBL_EPSILON)
+ if ((FLT_MIN - POPT_ABS(aDouble)) > DBL_EPSILON)
return POPT_ERROR_OVERFLOW;
arg.floatp[0] = (float) aDouble;
}