nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.56k stars 1.47k forks source link

`importc` should imply `cdecl` #13262

Open arnetheduck opened 4 years ago

arnetheduck commented 4 years ago

importc is used to import C functions - it stands to reason that these should not use nimcall calling convention by default, but rather cdecl - not doing this leads to unexpected failures when calling C functions, for example on win32.

nim 1.0.x

Araq commented 4 years ago

This will break when you use importc for a DLL written in Nim but I had some ideas how to deal with this.

arnetheduck commented 4 years ago

sounds like a use case that deserves an import without c