If C functions you want to import are declared with specific calling 
convention, you would need to import them with same calling convention. 
<https://osdev.wiki/pages/calling_conventions.html>

If you import C functions using header pragma, you would not need to specify 
calling convention.

C macro is not a C functions, just looks like a function when you call it. You 
don't need to specify calling convention.

For example:
    
    
    {.emit: """
    #define CMACRO(a,b) ((a) > (b) ? (a): (b))
    """.}
    
    proc cmacro(a, b: int): int {.importc: "CMACRO", nodecl.}
    proc cmacro(a, b: float): float {.importc: "CMACRO", nodecl.}
    
    echo cmacro(10, 100)
    echo cmacro(-1.0, 0)
    
    Run

If C macros are defined in header file, you need to use `header` pragma instead 
of `nodecl`.

Reply via email to