Closed Ruin0x11 closed 5 years ago
What version of MSVC are you using? I have only tested on 2017. Will Janet compile if near is changed to another identifier?
Yes, it will compile if it is renamed to e.g. nearr
. I tested on 2017 also.
Ah, makes sense. The amalgamated build will include windows.h near the top, which will define near and far macros.
The latest master has the suggested fix as of commit a303704a7d8eca79624eb79ebcdb12df871ec7c9. I will work on adding tests for the amalgamated source to the CI.
When trying to embed the output
janet.c
into a program compiled by MSVC, these errors occur.It's because of this code.
https://github.com/janet-lang/janet/blob/41bb6a9833cbb06ff1b83c10b42e446330eadd21/src/core/emit.c#L241-L246
near
is a reserved C keyword in some compilers.