Skip to content

Commit

Permalink
ensure ::(u)int8_t and std::(u)int8_t are the same type
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Mar 31, 2022
1 parent 654e882 commit 74a05b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion python/cppyy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ def _set_pch():

#- external typemap ----------------------------------------------------------
from . import _typemap
_typemap.initialize(_backend)
_typemap.initialize(_backend) # also creates (u)int8_t mapper

try:
gbl.std.int8_t = gbl.int8_t # ensures same _integer_ type
gbl.std.uint8_t = gbl.uint8_t
except (AttributeError, TypeError):
pass


#- pythonization factories ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion python/cppyy/_typemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def initialize(backend):

# integer types
int_tm = _create_mapper(int)
for tp in ['short', 'unsigned short', 'int']:
for tp in ['int8_t', 'uint8_t', 'short', 'unsigned short', 'int']:
tm[tp] = int_tm

if sys.hexversion < 0x3000000:
Expand Down

0 comments on commit 74a05b8

Please sign in to comment.