[Utils] Use gmtime_s with _WIN32#914
Merged
codeofalltrades merged 1 commit intoVeil-Project:masterfrom Apr 12, 2021
Merged
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. |
CaveSpectre11
approved these changes
Apr 5, 2021
This allows the project to build in WSL/Ubuntu 20.04 x64 and potentially other Windows versions.
e1b5e3c to
aa7e26e
Compare
Collaborator
Author
|
According to |
CaveSpectre11
approved these changes
Apr 10, 2021
Collaborator
|
Ack aa7e26e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.