From 878c296928d1a1e890b587fcbbd5314265b56527 Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 24 Jan 2025 22:09:54 +0100 Subject: poll: fix nfds_t size on Android bionic uses uint. Why? Why indeed... --- src/io/poll.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/io') 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: "".} = culong else: type nfds_t {.importc, header: "".} = cuint -- cgit