[pypy-svn] r79298 - in pypy/branch/jit-free/pypy/translator/c: . test

arigo at codespeak.net arigo at codespeak.net
Sat Nov 20 15:09:54 CET 2010


Author: arigo
Date: Sat Nov 20 15:09:53 2010
New Revision: 79298

Modified:
   pypy/branch/jit-free/pypy/translator/c/funcgen.py
   pypy/branch/jit-free/pypy/translator/c/test/test_standalone.py
Log:
Win32 support, and test.


Modified: pypy/branch/jit-free/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/branch/jit-free/pypy/translator/c/funcgen.py	(original)
+++ pypy/branch/jit-free/pypy/translator/c/funcgen.py	Sat Nov 20 15:09:53 2010
@@ -1,3 +1,4 @@
+import sys
 from pypy.translator.c.support import USESLOTS # set to False if necessary while refactoring
 from pypy.translator.c.support import cdecl
 from pypy.translator.c.support import llvalue_from_constant, gen_assignments
@@ -758,9 +759,15 @@
                 argv.append('(%s) ? "True" : "False"' % self.expr(arg))
                 continue
             elif T == SignedLongLong:
-                format.append('%lld')
+                if sys.platform == 'win32':
+                    format.append('%I64d')
+                else:
+                    format.append('%lld')
             elif T == UnsignedLongLong:
-                format.append('%llu')
+                if sys.platform == 'win32':
+                    format.append('%I64u')
+                else:
+                    format.append('%llu')
             else:
                 raise Exception("don't know how to debug_print %r" % (T,))
             argv.append(self.expr(arg))

Modified: pypy/branch/jit-free/pypy/translator/c/test/test_standalone.py
==============================================================================
--- pypy/branch/jit-free/pypy/translator/c/test/test_standalone.py	(original)
+++ pypy/branch/jit-free/pypy/translator/c/test/test_standalone.py	Sat Nov 20 15:09:53 2010
@@ -272,7 +272,7 @@
             x = "got:"
             debug_start  ("mycat")
             if have_debug_prints(): x += "b"
-            debug_print    ("foo", 2, "bar", 3)
+            debug_print    ("foo", r_longlong(2), "bar", 3)
             debug_start      ("cat2")
             if have_debug_prints(): x += "c"
             debug_print        ("baz")



More information about the Pypy-commit mailing list