aboutsummaryrefslogtreecommitdiffstats
path: root/src/io
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-24 22:09:54 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-24 22:09:54 +0100
commit878c296928d1a1e890b587fcbbd5314265b56527 (patch)
tree0b3c4c1cb6c350d99bb03ac8c7e4dd11cf8ce40a /src/io
parent962d3287d9af5654ff203d539cb5f8cbb685ba1a (diff)
downloadchawan-878c296928d1a1e890b587fcbbd5314265b56527.tar.gz
poll: fix nfds_t size on Android
bionic uses uint. Why? Why indeed...
Diffstat (limited to 'src/io')
-rw-r--r--src/io/poll.nim8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/io/poll.nim b/src/io/poll.nim
index 62a34d91..ea362b14 100644
--- a/src/io/poll.nim
+++ b/src/io/poll.nim
@@ -2,9 +2,11 @@ from std/posix import TPollfd, POLLNVAL
# NB: nfds_t on SVR4 this was unsigned long, but BSDs use unsigned int.
# Linux and Haiku emulate the former, BSDs inherit the latter.
-# Since there are less SVR4 imitators than BSD descendants, I'll just
-# hardcode the former.
-when defined(linux) or defined(haiku):
+# ...except bionic copy-pasted from BSD headers, so it uses the latter
+# too.
+# Since there are less SVR4 imitators than BSD descendants, I'll use
+# the latter as the fallback.
+when defined(linux) and not defined(android) or defined(haiku):
type nfds_t {.importc, header: "<poll.h>".} = culong
else:
type nfds_t {.importc, header: "<poll.h>".} = cuint