# New Ticket Created by  "Sean O'Rourke" 
# Please include the string:  [perl #19090]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=19090 >


The following defines a macro VA_TO_VAPTR(x) to convert va_list arguments
to pointers in a platform-independent way.  Works for me on Linux-ppc.
Could someone with another CPU give it a spin and/or make sure I hid the
macro in the right part of {config/,lib/Parrot/Configure,...}?

/s


-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/45059/35500/f05e2e/va.patch

Index: misc.c
===================================================================
RCS file: /cvs/public/parrot/misc.c,v
retrieving revision 1.30
diff -p -u -w -r1.30 misc.c
--- misc.c      10 Dec 2002 14:24:12 -0000      1.30
+++ misc.c      12 Dec 2002 23:51:53 -0000
@@ -35,7 +35,7 @@ STRING *
 Parrot_vsprintf_s(struct Parrot_Interp *interpreter, STRING *pat, va_list args)
 {
     SPRINTF_OBJ obj = va_core;
-    obj.data = &args;
+    obj.data = VA_TO_VAPTR(args);
 
     return Parrot_sprintf_format(interpreter, pat, &obj);
 }
Index: config/gen/feature_h/feature_h.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/feature_h/feature_h.in,v
retrieving revision 1.1
diff -p -u -w -r1.1 feature_h.in
--- config/gen/feature_h/feature_h.in   12 Dec 2002 11:20:44 -0000      1.1
+++ config/gen/feature_h/feature_h.in   12 Dec 2002 23:51:55 -0000
@@ -15,6 +15,15 @@ if (${jit_i386} && ${jit_i386} eq 'fcomi
        print OUT "#endif\n";
 }
 
+if (${jitcpuarch} eq 'ppc') {
+    print OUT <<'END';
+#define VA_TO_VAPTR(x) (x)
+END
+} else {
+    print OUT <<'END';
+#define VA_TO_VAPTR(x) (&(x))
+END
+}
 
 #endif guard
 print OUT "\n\n#endif\n"

Reply via email to