-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os.putEnv
does not compile on cpp backend on Windows
#19292
Comments
There is a regression since #20084 |
ringabout
added a commit
that referenced
this issue
Dec 20, 2022
survivorm
pushed a commit
to survivorm/Nim
that referenced
this issue
Feb 28, 2023
…ith vcc (nim-lang#21143) * fixes nim-lang#19292; fixes 21122; fixes putEnv and setEnv with vcc * add a test
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
…ith vcc (nim-lang#21143) * fixes nim-lang#19292; fixes 21122; fixes putEnv and setEnv with vcc * add a test
bung87
pushed a commit
to bung87/Nim
that referenced
this issue
Jul 29, 2023
…ith vcc (nim-lang#21143) * fixes nim-lang#19292; fixes 21122; fixes putEnv and setEnv with vcc * add a test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
os.putEnv
does not compile on the cpp backend on Windows. The problem occurs with GCC, CLANG and VCC.Example
Current Output
GCC
CLANG
VCC
Expected Output
Compile without errors.
Possible Solution
The problem is that the backend compilers do not support the conversion from Nim type
WideCString
to cpp typewchar_t*
.The solution is to rewrite the code to import the
c_wgetenv
andmbstowcs_s
procs with parameters likeptr wchar_t
instead ofWideCString
. Also, pass the parameters withcast[ptr wchar_t]()
.Additional Information
The text was updated successfully, but these errors were encountered: