summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-03-03 05:33:21 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-03-03 05:33:21 +0000
commit32fdb0651975fc8e2d4b926fd3bd5792b31acf57 (patch)
tree01c466e5ad08fc6610f100c9b26b71394eaff504 /perl.h
parent22adf171e6a33aa2d076b4a9a86b73487d6534c0 (diff)
downloadperl-32fdb0651975fc8e2d4b926fd3bd5792b31acf57.tar.gz
Use a macro for abs() to avoid the possible truncation to an int;
also make an explicit (double)cast for the arguments to fabs(). p4raw-id: //depot/perl@18813
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index a2f8c430f1..0253a435b8 100644
--- a/perl.h
+++ b/perl.h
@@ -4240,6 +4240,10 @@ extern void moncontrol(int);
# define PERL_BLOCKSIG_UNBLOCK(set) NOOP
#endif
+/* Use instead of abs() since abs() forces its argument to be an int,
+ * but also beware since evaluates its argument thrice. */
+#define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
+
/* and finally... */
#define PERL_PATCHLEVEL_H_IMPLICIT
#include "patchlevel.h"