Minor change? Nim supports ~8 Posix-like OSes on ~5 different CPU
architectures. I wrote a tool "detect.nim" to extract these values at build
time (similar to what autoconf does) but it's not clear how to incorporate it
into Nim's build system.
Thanks Andreas. Would you consider such a minor change in stdlib as desirable?
There is no solution but to patch posix.nim so that it knows the actual values
for the popular OSes out there.
Thank you @jlp765, I know about the static, but asking about a different thing:
Is there a way in nim language to use values of S_IFREG and S_IFDIR in the 'of'
clause of the 'case-of' statement? (for example, like in the post above)
Have a look at
[static](https://nim-lang.org/docs/manual.html#statements-and-expressions-static-statement-expression)
static:
# compile time stuff here
Is there a way to make nim compiler to evaluate constants from C-header files
at compile time?
For example, symbols S_IFREG and S_IFDIR (from posix.nim <\- sys/stat.h) used
in following code snippet:
case x:
of S_IFREG: echo "file"
of S_IFDIR: echo "dir"
else: