fixes #24434; C gen issue using nim-lang/opengl (#24435)

fixes #24434

In https://github.com/nim-lang/Nim/pull/24432

```nim
let ex = "NIM_EXTERNC N_NIMCALL(void, nimLoadProcs$1)(void) {$2}$N$N" %
        [(i.ord - '0'.ord).rope, extract(el)]
```

```nim
procs.addDeclWithVisibility(ExternC):
   procs.addProcHeader(ccNimCall, "nimLoadProcs" & $(i.ord - '0'.ord), "void", cProcParams())
```

extern "C" makes a function-name in C++ have C linkage; it should be
effaced with C compiler
This commit is contained in:
ringabout
2024-11-16 05:51:58 +08:00
committed by GitHub
parent 371f50f66d
commit cd9ce377f8

View File

@@ -404,7 +404,7 @@ proc addVisibilityPrefix(builder: var Builder, visibility: DeclVisibility) =
of Extern:
builder.add("extern ")
of ExternC:
builder.add("extern \"C\" ")
builder.add("NIM_EXTERNC ")
of ImportLib:
builder.add("N_LIB_IMPORT ")
of ExportLib: