Skip to content

Commit db2d883

Browse files
author
roman_yakovenko
committed
"__int128_t" and "__uint128_t" types were introduced. Many thanks to Gustavo Carneiro for the patch
1 parent d995228 commit db2d883

File tree

7 files changed

+37
-1
lines changed

7 files changed

+37
-1
lines changed

docs/history/history.rest

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ SVN Version
6060
`elif sys.platform == 'linux2' or sys.platform == 'darwin'` with `os.name == 'posix'`,
6161
as suggested by `Jakub Wilk <http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/572d2286ca0b2cec?pli=1>`
6262

63+
11. "__int128_t" and "__uint128_t" types were introduced. Many thanks to Gustavo Carneiro
64+
for providing the patch.
65+
6366
-----------
6467
Version 1.0
6568
-----------

pygccxml/declarations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
from cpptypes import long_unsigned_int_t
4343
from cpptypes import long_long_int_t
4444
from cpptypes import long_long_unsigned_int_t
45+
from cpptypes import int128_t
46+
from cpptypes import uint128_t
4547
from cpptypes import float_t
4648
from cpptypes import double_t
4749
from cpptypes import long_double_t

pygccxml/declarations/cpptypes.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,19 @@ class jboolean_t( java_fundamental_t ):
302302
def __init__( self ):
303303
java_fundamental_t.__init__( self, jboolean_t.JNAME )
304304

305+
class int128_t( fundamental_t ):
306+
"""represents __int128_t type"""
307+
CPPNAME = '__int128_t'
308+
def __init__( self ):
309+
fundamental_t.__init__( self, int128_t.CPPNAME )
310+
311+
class uint128_t( fundamental_t ):
312+
"""represents __uint128_t type"""
313+
CPPNAME = '__uint128_t'
314+
def __init__( self ):
315+
fundamental_t.__init__( self, uint128_t.CPPNAME )
316+
317+
305318
FUNDAMENTAL_TYPES = {
306319
void_t.CPPNAME : void_t()
307320
, char_t.CPPNAME : char_t()
@@ -319,6 +332,8 @@ def __init__( self ):
319332
, long_unsigned_int_t.CPPNAME : long_unsigned_int_t()
320333
, long_long_int_t.CPPNAME : long_long_int_t()
321334
, long_long_unsigned_int_t.CPPNAME : long_long_unsigned_int_t()
335+
, int128_t.CPPNAME : int128_t()
336+
, uint128_t.CPPNAME : uint128_t()
322337
, float_t.CPPNAME : float_t()
323338
, double_t.CPPNAME : double_t()
324339
, long_double_t.CPPNAME : long_double_t()

pygccxml/declarations/type_traits.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ def is_integral( type ):
142142
+ create_cv_types( cpptypes.long_int_t() ) \
143143
+ create_cv_types( cpptypes.long_unsigned_int_t() ) \
144144
+ create_cv_types( cpptypes.long_long_int_t() ) \
145-
+ create_cv_types( cpptypes.long_long_unsigned_int_t() )
145+
+ create_cv_types( cpptypes.long_long_unsigned_int_t() ) \
146+
+ create_cv_types( cpptypes.int128_t() ) \
147+
+ create_cv_types( cpptypes.uint128_t() )
146148

147149
return remove_alias( type ) in integral_def
148150

pygccxml/declarations/type_visitor.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ def visit_long_long_int( self ):
5858
def visit_long_long_unsigned_int( self ):
5959
raise NotImplementedError()
6060

61+
def visit_int128( self ):
62+
raise NotImplementedError()
63+
64+
def visit_uint128( self ):
65+
raise NotImplementedError()
66+
6167
def visit_float( self ):
6268
raise NotImplementedError()
6369

pygccxml/parser/linker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ def visit_long_long_int( self ):
188188
def visit_long_long_unsigned_int( self ):
189189
pass
190190

191+
def visit_int128( self ):
192+
pass
193+
194+
def visit_uint128( self ):
195+
pass
196+
191197
def visit_float( self ):
192198
pass
193199

unittests/core_tester.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def test_fundamental_types(self):
177177
for fundamental_type_name, fundamental_type in FUNDAMENTAL_TYPES.iteritems():
178178
if 'complex' in fundamental_type_name:
179179
continue #I check this in an other tester
180+
if isinstance( fundamental_type, (int128_t, uint128_t) ):
181+
continue #I don't have test case for this
180182
if isinstance( fundamental_type, java_fundamental_t ):
181183
continue #I don't check this at all
182184
typedef_name = 'typedef_' + fundamental_type_name.replace( ' ', '_' )

0 commit comments

Comments
 (0)