Skip to content

Commit

Permalink
fixes #24434; C gen issue using nim-lang/opengl (#24435)
Browse files Browse the repository at this point in the history
fixes #24434

In #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
  • Loading branch information
ringabout authored Nov 15, 2024
1 parent 371f50f commit cd9ce37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/cbuilderdecls.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cd9ce37

Please sign in to comment.