nim-lang / c2nim

c2nim is a tool to translate Ansi C code to Nim. The output is human-readable Nim code that is meant to be tweaked by hand before and after the translation process.
MIT License
509 stars 63 forks source link

fails to parse `typedef struct` with ifdef inside #239

Open arnetheduck opened 2 years ago

arnetheduck commented 2 years ago
typedef struct {
    const br_sslrec_in_cbc_class *vtable;
#ifndef BR_DOXYGEN_IGNORE
    uint64_t seq;
    union {
        const br_block_cbcdec_class *vtable;
        br_aes_gen_cbcdec_keys aes;
        br_des_gen_cbcdec_keys des;
    } bc;
    br_hmac_key_context mac;
    size_t mac_len;
    unsigned char iv[16];
    int explicit_IV;
#endif
} br_sslrec_in_cbc_context;
test.c(15, 28) Warning: token expected: ; but got: { [SyntaxError]