[pypy-commit] pypy default: Rename "__int128" into "__int128_t". It seems that it's more standard,

arigo noreply at buildbot.pypy.org
Thu Sep 6 13:30:45 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r57173:ce8aadf6c8ba
Date: 2012-09-06 13:18 +0200
http://bitbucket.org/pypy/pypy/changeset/ce8aadf6c8ba/

Log:	Rename "__int128" into "__int128_t". It seems that it's more
	standard, supported by older GCCs on some platforms and by CLang.
	Moreover it seems that gcc 4.7, which introduced "__int128", also
	added "__int128_t".

diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -12,7 +12,7 @@
 
 import math, sys
 
-SUPPORT_INT128 = rffi_platform.has('__int128', '')
+SUPPORT_INT128 = rffi_platform.has('__int128_t', '')
 
 # note about digit sizes:
 # In division, the native integer type must be able to hold
@@ -26,7 +26,7 @@
         UDIGIT_MASK = intmask
     else:
         UDIGIT_MASK = longlongmask
-    LONG_TYPE = rffi.__INT128
+    LONG_TYPE = rffi.__INT128_T
     if LONG_BIT > SHIFT:
         STORE_TYPE = lltype.Signed
         UNSIGNED_TYPE = lltype.Unsigned
diff --git a/pypy/rpython/lltypesystem/ll2ctypes.py b/pypy/rpython/lltypesystem/ll2ctypes.py
--- a/pypy/rpython/lltypesystem/ll2ctypes.py
+++ b/pypy/rpython/lltypesystem/ll2ctypes.py
@@ -139,8 +139,8 @@
         llmemory.WeakRef:  ctypes.c_void_p, # XXX
         })
         
-    if '__int128' in rffi.TYPES:
-        _ctypes_cache[rffi.__INT128] = ctypes.c_longlong # XXX: Not right at all. But for some reason, It started by while doing JIT compile after a merge with default. Can't extend ctypes, because thats a python standard, right?
+    if '__int128_t' in rffi.TYPES:
+        _ctypes_cache[rffi.__INT128_T] = ctypes.c_longlong # XXX: Not right at all. But for some reason, It started by while doing JIT compile after a merge with default. Can't extend ctypes, because thats a python standard, right?
 
     # for unicode strings, do not use ctypes.c_wchar because ctypes
     # automatically converts arrays into unicode strings.
diff --git a/pypy/rpython/lltypesystem/rffi.py b/pypy/rpython/lltypesystem/rffi.py
--- a/pypy/rpython/lltypesystem/rffi.py
+++ b/pypy/rpython/lltypesystem/rffi.py
@@ -441,8 +441,8 @@
 
 # This is a bit of a hack since we can't use rffi_platform here.
 try:
-    sizeof_c_type('__int128', ignore_errors=True)
-    TYPES += ['__int128']
+    sizeof_c_type('__int128_t', ignore_errors=True)
+    TYPES += ['__int128_t']
 except CompilationError:
     pass
     
diff --git a/pypy/translator/c/primitive.py b/pypy/translator/c/primitive.py
--- a/pypy/translator/c/primitive.py
+++ b/pypy/translator/c/primitive.py
@@ -13,7 +13,7 @@
 from pypy.translator.c.support import cdecl, barebonearray
 
 from pypy.rpython.tool import rffi_platform
-SUPPORT_INT128 = rffi_platform.has('__int128', '')
+SUPPORT_INT128 = rffi_platform.has('__int128_t', '')
 
 # ____________________________________________________________
 #
@@ -251,4 +251,4 @@
 define_c_primitive(rffi.LONGLONG, 'long long', 'LL')
 define_c_primitive(rffi.ULONGLONG, 'unsigned long long', 'ULL')
 if SUPPORT_INT128:
-    define_c_primitive(rffi.__INT128, '__int128', 'LL') # Unless it's a 128bit platform, LL is the biggest
\ No newline at end of file
+    define_c_primitive(rffi.__INT128_T, '__int128_t', 'LL') # Unless it's a 128bit platform, LL is the biggest


More information about the pypy-commit mailing list