This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Workaround for initialization errors on HP's pre-compiler
authorH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 27 Feb 2006 13:28:04 +0000 (13:28 +0000)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 27 Feb 2006 13:28:04 +0000 (13:28 +0000)
Do not ask me to explain. This re-definition works on AIX
and HP-UX. Let's await the smokes.

p4raw-id: //depot/perl@27338

sv.c

diff --git a/sv.c b/sv.c
index 66b4d8e..e698ddf 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -875,9 +875,16 @@ struct body_details {
    limited by PERL_ARENA_SIZE, so we can safely oversize the
    declarations.
  */
-#define FIT_ARENA(count, body_size)                    \
-    (!count || count * body_size > PERL_ARENA_SIZE)    \
-       ? (int)(PERL_ARENA_SIZE / body_size) * body_size : count * body_size
+#define FIT_ARENA0(body_size)                          \
+    ((size_t)(PERL_ARENA_SIZE / body_size) * body_size)
+#define FIT_ARENAn(count,body_size)                    \
+    ( count * body_size <= PERL_ARENA_SIZE)            \
+    ? count * body_size                                        \
+    : FIT_ARENA0 (body_size)
+#define FIT_ARENA(count,body_size)                     \
+    count                                              \
+    ? FIT_ARENAn (count, body_size)                    \
+    : FIT_ARENA0 (body_size)
 
 /* A macro to work out the offset needed to subtract from a pointer to (say)