use HAVE_NO_POWL instead of defined(_AIX) && (!defined(HAS_LONG_DOUBLE) || AIX_WORKAROUND)
Reini Urban
10 years ago
16 | 16 | |
17 | 17 | #if defined(__BORLANDC__) || defined(_MSC_VER) |
18 | 18 | # 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 | |
19 | 23 | #endif |
20 | 24 | |
21 | 25 | /* some old perls do not have this, try to make it work, no */ |
236 | 240 | /*/////////////////////////////////////////////////////////////////////////// */ |
237 | 241 | /* fp hell */ |
238 | 242 | |
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. | |
245 | 249 | NEED TO MODIFY Makefile, after perl Makefile.PL by adding "-lm" onto the LDDLFLAGS line */ |
246 | 250 | static double fs_powEx(double x, double y) |
247 | 251 | { |
332 | 336 | /* implementation is hard to beat. */ |
333 | 337 | /* (IEEE 754 conformant ones are required to be exact) */ |
334 | 338 | if (postdp) *expo -= eaccum; |
335 | #if defined(_AIX) && (!defined(HAS_LONG_DOUBLE) || AIX_WORKAROUND) | |
339 | #ifdef HAVE_NO_POWL | |
336 | 340 | /* powf() unfortunately is not accurate enough */ |
337 | 341 | *accum += uaccum * fs_powEx(10., *expo ); |
338 | 342 | #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(...) */ | |
341 | 343 | *accum += uaccum * Perl_pow (10., *expo); |
342 | 344 | #endif |
343 | 345 | *expo += eaccum; |