I want to wrap a C++ _#define_ macro in a way that my Nim code is translated to 
this in C++: 
    
    
    CPP_DEFINED_MACRO(cpp_defined_identifier) {
      cpp_defined_function(param1);
      other_cpp_defined_function(param2, param3);
    }
    

Currently, I produce the entire block with an _emit_ pragma. Can this be done 
more elegantly?

If not, could this at least be accomplished with using _emit_ only for the 
first and last line of the block while using a wrapped version of the C++ 
defined functions in between? I tried this with two separate _emit_ s for the 
first and the last line, but they end up in a completely different part of the 
generated C++ code than the calls to the functions. This only happens when the 
code is in the top level of the module, but unfortunately it has to be there.

Reply via email to