Author: Armin Rigo <[email protected]>
Branch:
Changeset: r67915:ca509b853772
Date: 2013-11-09 23:30 +0100
http://bitbucket.org/pypy/pypy/changeset/ca509b853772/
Log: Import cffi/ec61ea587ec6
diff --git a/lib_pypy/cffi/vengine_gen.py b/lib_pypy/cffi/vengine_gen.py
--- a/lib_pypy/cffi/vengine_gen.py
+++ b/lib_pypy/cffi/vengine_gen.py
@@ -393,7 +393,8 @@
negative = function(p)
value = int(p[0])
if value < 0 and not negative:
- value += (1 << (8*self.ffi.sizeof("long long")))
+ BLongLong = self.ffi._typeof_locked("long long")[0]
+ value += (1 << (8*self.ffi.sizeof(BLongLong)))
else:
BFunc = self.ffi._typeof_locked(tp.get_c_name('(*)(void)',
name))[0]
function = module.load_function(BFunc, funcname)
diff --git a/pypy/module/test_lib_pypy/cffi_tests/test_verify.py
b/pypy/module/test_lib_pypy/cffi_tests/test_verify.py
--- a/pypy/module/test_lib_pypy/cffi_tests/test_verify.py
+++ b/pypy/module/test_lib_pypy/cffi_tests/test_verify.py
@@ -708,11 +708,14 @@
def test_define_int():
ffi = FFI()
ffi.cdef("#define FOO ...\n"
- "\t#\tdefine\tBAR\t...\t")
+ "\t#\tdefine\tBAR\t...\t\n"
+ "#define BAZ ...\n")
lib = ffi.verify("#define FOO 42\n"
- "#define BAR (-44)\n")
+ "#define BAR (-44)\n"
+ "#define BAZ 0xffffffffffffffffLL\n")
assert lib.FOO == 42
assert lib.BAR == -44
+ assert lib.BAZ == 0xffffffffffffffff
def test_access_variable():
ffi = FFI()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit