Open brechtsanders opened 3 months ago
thats why i labled it as a pre-release, you know. Will discuss with Garrett on it.
related to https://github.com/nanomsg/nng/pull/1826 you can try port the code if you have your own fork... seems like garrett not being happy with MinGW
Sorry to hear that.
I'm offering the solution on a plate here . If it doesn't get incorporated I guess will just keep patching my builds.
Just trying to help - as an open source developer.
Sorry to hear that.
I'm offering the solution on a plate here . If it doesn't get incorporated I guess will just keep patching my builds.
Just trying to help - as an open source developer.
But we definitely could figure it out in NanoNNG fork.
Tried with your way works. Tried without your way, also works.
I am using Win10 with MinGW
@JaylinYu The issue is specifically with MSVCRT toolchain, if you're using UCRT the issue will not happen.
When building nanonng version 0.21.9 for Windows with an MSVCRT MinGW-w64 toolchain the build fails in
src/platform/windows/win_clock.c
becausetimespec_get()
is not defined (it does exist in UCRT MinGW-w64).The solution is to modify
nni_time_get()
insrc/platform/windows/win_clock.c
to only use thetimespec_get()
implementation when building against UCRT (using#ifdef _UCRT
) and otherwise fall back to another implementation, for example the same fallback based ingettimeofday()
used insrc/platform/posix/posix_clock.c
.On a side note, the line
int rv;
innni_time_get()
insrc/platform/windows/win_clock.c
is unused.I was able to build when after modifying
nni_time_get()
insrc/platform/windows/win_clock.c
as follows:Note that I haven't tested it yet, and maybe there is a better way (with a more granular clock) to do this.