Closed starsiderfox closed 4 months ago
The change itself looks good, but the PR descriptions needs adjustment.
Please make sure that the summary makes it clear what didn't work and works now, namely that importing the sysrand
module (directly or indirectly) caused compilation failures when building for Android or some other Posix platforms.
The change itself looks good, but the PR descriptions needs adjustment.
Please make sure that the summary makes it clear what didn't work and works now, namely that importing the
sysrand
module (directly or indirectly) caused compilation failures when building for Android or some other Posix platforms.
Done
/merge
Merge requested by: @zerbina
Contents after the first section break of the PR description has been removed and preserved below:
Summary
Fixes a bug that caused the compiler to fail to compile anything with e.g.
--os:android
(and some uncommon POSIX platforms) when it usessysrand
in any way, such as when importingrandom
.koch
was affected so one couldn't bootstrap nimskull in android as the host platform.Details
There's two POSIX constants used in
sysrand.nim
that are not actually constants for some platforms like Android.EINTR
andEAGAIN
are required to be constants at compile time because they're used in acase of
but the condition is so simple that we can replace it by anif
statement.They're technically constants in all platforms, but on the C side (taken from
errno.h
), not in nimskull, and the latter is oblivious to the content of those header files.