After reading some Nim code from stdlib, I think I can get away by defining 
SOCK_CLOEXEC to 0. What do you think? I could pass -DSOCK_CLOEXEC=0 to a C 
compiler, but I was thinking if I could do it using Nim. I've created 
fixups.nim file with:

> {. emit("""
> 
> #ifndef SOCK_CLOEXEC
>     #define SOCK_CLOEXEC 0
> 
> #endif """) .}

And then added --include:fixups.nim to the generation command, but for some 
reason the emmitted code isn't added to the to top of C files generated. Maybe 
I'm doing something wrong here? I thought that --include parameter includes 
code to all modules, including stdlib, isn't that so?

Reply via email to