[Utils] Use gmtime_s with _WIN32#914
Conversation
|
@codeofalltrades had mentioned to make this change to support windows as well. I was encountering this issue and lazily just defaulted to gmtime_s, but this is a much better approach. |
There was a problem hiding this comment.
Ran a test with changing Github Actions to use Ubuntu 20. This does solve the Win64 issue with ubuntu 20; but the same problem exists for Win32; So it looks like it needs one more conditional on that # if.
See here:
https://github.com/CaveSpectre11/veil/runs/2274102054?check_suite_focus=true
This allows the project to build in WSL/Ubuntu 20.04 x64 and potentially other Windows versions.
e1b5e3c to
aa7e26e
Compare
|
According to |
CaveSpectre11
left a comment
There was a problem hiding this comment.
ACK aa7e26e
https://github.com/CaveSpectre11/veil/actions/runs/736392142 (Ubuntu 20 actions)
|
Ack aa7e26e |
Problem
Following the build instructions for WSL with Ubuntu 20.04 resulted in this error:
Manually changing
gmtime_rtogmtime_sresults in a further warning because the arguments are reversed, a sign that we're building with the Windows version that the code uses when_MSC_VERis set.Root Cause
WSL with Ubuntu 20.04 is not building with msvc but with mingw.
Solution
Use the Windows version of this code when either
_MSC_VERor__MINGW64__is set.(Note: I also needed to change the build command
make HOST=x86_64-w64-mingw32toCC_FOR_BUILD=x86_64-linux-gnu-gcc make HOST=x86_64-w64-mingw32in order to build gmp, but I was not sure if I should update the docs.)Bounty PR
None
Bounty Payment Address
sv1qqpswvjy7s9yrpcmrt3fu0kd8rutrdlq675ntyjxjzn09f965z9dutqpqgg85esvg8mhmyka5kq5vae0qnuw4428vs9d2gu4nz643jv5a72wkqqq73mnxrUnit Testing Results
Tested on win64 mingw WSL/Ubuntu 20.04 by building successfully and running unittests successfully compared to master.