I'm compiling with Windows & VCC/cl and I keep having an issue with a wrapper for a C++ function.
This part of the code seems to be the culprit:
https://github.com/arturo-lang/arturo/blob/improve-webview-and-ui/src/helpers/dialogs.nim#L55-L61
Here is the wrapper I've written:
https://github.com/arturo-lang/arturo/blob/improve-webview-and-ui/src/extras/pfd.nim#L64-L65
And here are the referenced function (in the C/C++ code):
https://github.com/arturo-lang/arturo/blob/improve-webview-and-ui/src/extras/pfd/pfd.cc#L1760-L1767
The exact same thing compiles & works for every other compiler/os combination.
What is going on?
Initializing char* (NCSTRING) variable from const char* is compile error in C++. It is warning in gcc, but it might be compile error in VCC. https://wandbox.org/permlink/oEDwBo3TmQfo3SQ5
You might fix the error by not using header pragma. Or cast return value to cstring might or might not fix it. Or somehow insert C or C++ cast like (char*)(function_return_const_char(arg)) or const_cast<char*>(function_return_const_char(arg)).
result = $cast[cstring](cresult)