ffilib: Port .bitness from _libc.

pull/43/head
Paul Sokolovsky 2015-08-30 03:13:37 +03:00
rodzic 281feeb6d9
commit 937cbf330c
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -30,3 +30,12 @@ def open(name, maxver=10, extra=()):
def libc():
return open("libc", 6)
# Find out bitness of the platform, even if long ints are not supported
# TODO: All bitness differences should be removed from micropython-lib, and
# this snippet too.
bitness = 1
v = sys.maxsize
while v:
bitness += 1
v >>= 1