select: Add yet another workaround for struct epoll_event, this time for x86_64.

So, it's now clear that dealing with this struct should be rather moved on C side.
pull/7/head
Paul Sokolovsky 2014-09-06 19:36:28 +03:00
rodzic 22da54bc83
commit 165fbbd768
4 zmienionych plików z 17 dodań i 3 usunięć

Wyświetl plik

@ -1,4 +1,5 @@
import ffi
import sys
_h = None
@ -22,3 +23,12 @@ def get():
def set_names(n):
global names
names = n
# 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

Wyświetl plik

@ -1,5 +1,5 @@
srctype = micropython-lib
type = module
version = 0.0.8
version = 0.1
author = Paul Sokolovsky
depends = os, libc

Wyświetl plik

@ -26,7 +26,11 @@ EPOLL_CTL_MOD = 3
# On x86, uint64_t is 4-byte aligned, on many other platforms - 8-byte.
# Until uctypes module can assign native struct offset, use dirty hack
# below.
if struct.calcsize("IQ") == 12:
# TODO: Get rid of all this dirtiness, move it on C side
if _libc.bitness > 32:
# On x86_64, epoll_event is packed struct
epoll_event = "<IO"
elif struct.calcsize("IQ") == 12:
epoll_event = "IO"
else:
epoll_event = "QO"

Wyświetl plik

@ -6,7 +6,7 @@ from setuptools import setup
setup(name='micropython-select',
version='0.0.8',
version='0.1',
description='select module for MicroPython',
long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.",
url='https://github.com/micropython/micropython/issues/405',