Codebase list libcpanel-json-xs-perl / 2.3403
use HAVE_NO_POWL instead of defined(_AIX) && (!defined(HAS_LONG_DOUBLE) || AIX_WORKAROUND) Reini Urban 10 years ago
1 changed file(s) with 11 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
1616
1717 #if defined(__BORLANDC__) || defined(_MSC_VER)
1818 # define snprintf _snprintf // C compilers have this in stdio.h
19 #endif
20
21 #if defined(_AIX) && (!defined(HAS_LONG_DOUBLE) || AIX_WORKAROUND)
22 #define HAVE_NO_POWL
1923 #endif
2024
2125 /* some old perls do not have this, try to make it work, no */
236240 /*/////////////////////////////////////////////////////////////////////////// */
237241 /* fp hell */
238242
239 #if defined(_AIX) && (!defined(HAS_LONG_DOUBLE) || AIX_WORKAROUND)
240 /* Ulisse Monari: this is a patch for AIX 5.3, perl 5.8.8 without USE_LONG_DOUBLE
241 core dumps at Perl_pow(...)
242
243 base code is from http://bytes.com/topic/c/answers/748317-replacement-pow-function
244 this is my change to fs_pow that goes into libc/libm for calling fmod/exp/log.
243 #ifdef HAVE_NO_POWL
244 /* Ulisse Monari: this is a patch for AIX 5.3, perl 5.8.8 without HAS_LONG_DOUBLE
245 There Perl_pow maps to pow(...) - NOT TO powl(...), core dumps at Perl_pow(...)
246
247 Base code is from http://bytes.com/topic/c/answers/748317-replacement-pow-function
248 This is my change to fs_pow that goes into libc/libm for calling fmod/exp/log.
245249 NEED TO MODIFY Makefile, after perl Makefile.PL by adding "-lm" onto the LDDLFLAGS line */
246250 static double fs_powEx(double x, double y)
247251 {
332336 /* implementation is hard to beat. */
333337 /* (IEEE 754 conformant ones are required to be exact) */
334338 if (postdp) *expo -= eaccum;
335 #if defined(_AIX) && (!defined(HAS_LONG_DOUBLE) || AIX_WORKAROUND)
339 #ifdef HAVE_NO_POWL
336340 /* powf() unfortunately is not accurate enough */
337341 *accum += uaccum * fs_powEx(10., *expo );
338342 #else
339 /* from perl.h on this AIX/perl588 box i have that USE_LONG_DOUBLE IS NOT defined */
340 /* then Perl_pow maps to pow(...) - NOT TO powl(...) */
341343 *accum += uaccum * Perl_pow (10., *expo);
342344 #endif
343345 *expo += eaccum;