I am struggling with this header: 
[Standard_Handle.hxx](https://pastebin.com/PnSKAX2S).

I hit several issues with it. I reported a couple of the issues: [parsing 
issue](https://github.com/nim-lang/c2nim/issues/223) and the most problematic 
one for me: [Token pasting operator 
`##`](https://github.com/nim-lang/c2nim/issues/224).

The closest I got was by using the modded version of the header 
[Standard_Handle.hxx](https://pastebin.com/acgcinBr). I have tried with this 
`standard_handle.c2nim`: 
    
    
    #ifdef C2NIM
    #skipcomments
    #skipinclude
    #pp DEFINE_STANDARD_HANDLE
    #pp Handle
    #pp DEFINE_STANDARD_HANDLECLASS
    #pp DEFINE_STANDARD_RTTIEXT
    #pp DEFINE_STANDARD_RTTI_INLINE
    #pp DEFINE_NCOLLECTION_ALLOC
    #endif
    
    
    Run

but when I run: 
    
    
    $ c2nim --cpp --header --strict --skipcomments --out:borrame.nim 
standard_handle.c2nim Standard_Handle.hxx
    Standard_Handle.hxx(345, 52) Error: token expected: ( but got: [identifier]
    
    
    Run

So I am struggling at the very end: 
    
    
    ++
    #define DEFINE_STANDARD_HANDLECLASS(C1,C2,BC) class C1; typedef Handle(C1) 
Handle_##C1;
    
    
    Run

What can I do to make it work?

Reply via email to