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

typedef struct { ... } xx [error bug?] because have #ifdef ... #endif before #265

Closed Angluca closed 1 year ago

Angluca commented 1 year ago

This struct contains one pixel. typedef struct { unsigned char r , g , b , a ; } pixel ; Error: expected ';'!!! cant gen pixel object. If havn't #ifdef ... #endif, It's ok.

#ifdef _MSC_VER
#define XXX static forceinline
#else
#define XXX static inline
#endif

typedef struct {
    unsigned char r, g, b, a;
} pixel;