Author: Armin Rigo <[email protected]>
Branch:
Changeset: r63050:20bd465b4b06
Date: 2013-04-05 12:20 +0200
http://bitbucket.org/pypy/pypy/changeset/20bd465b4b06/
Log: Use ctypes to get the size of "long double" reasonably. The issue
is that it's not always 12/16 on all platforms; e.g. on Windows it
is 8.
diff --git a/rpython/rtyper/lltypesystem/rffi.py
b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -934,10 +934,8 @@
if tp is lltype.SingleFloat:
return 4
if tp is lltype.LongFloat:
- if globals()['r_void*'].BITS == 32:
- return 12
- else:
- return 16
+ import ctypes # :-/
+ return ctypes.sizeof(ctypes.c_longdouble)
assert isinstance(tp, lltype.Number)
if tp is lltype.Signed:
return LONG_BIT/8
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit