Open snej opened 4 years ago
Adding #assumendef __cplusplus
to my .c2nim
file doesn't help (has no effect.)
The same bug occurs with input:
#ifdef __cplusplus
typedef bool BAR;
#endif
#ifndef __cplusplus
typedef int BAR;
#endif
Again, neither is parsed.
Irrc __cplusplus
is special cased in c2nim, please create a PR.
c2nim skips both sides of an
#ifdef __cplusplus ... #else ... #endif
block, i.e. it parses neither the lines after#ifdef
nor the lines after the#else
. I'd expect it to parse the first set of lines if I used the--cpp
flag, otherwise the second set.Example
Expected result
The output file includes either
type BAR = int
, ortype BAR = bool
if I gave the--cpp
flag.Actual result
There is no declaration of
BAR
at all.