0be03c7 Qt: Use _putenv_s instead of setenv on Windows builds (Brian McMichael)
Pull request description:
Fixes https://github.com/bitcoin/bitcoin/issues/10836 Error message I would get on `make`: ``` ... CXXLD bench/bench_bitcoin.exe OBJCXXLD qt/bitcoin-qt.exe qt/test/test_main.cpp: In function ‘int main(int, char**)’: qt/test/test_main.cpp:64:43: error: ‘setenv’ was not declared in this scope setenv("QT_QPA_PLATFORM", "minimal", 0); ^ make: *** [qt/test/qt_test_test_bitcoin_qt-test_main.o] Error 1 make: *** Waiting for unfinished jobs.... make: Leaving directory `/home/bmcmichael/Projects/bcoin/src' make: *** [all-recursive] Error 1 make: Leaving directory `/home/bmcmichael/Projects/bcoin/src' make: *** [all-recursive] Error 1 ``` `setenv` function is not available from the Microsoft runtime library. Need to use `_putenv_s` instead. This solution tells the compiler to use `_putenv_s` on `WIN32` compilation (Note: this also works on 64-bit Windows instances.) and `setenv` everywhere else. I've tested builds on Windows 10 x64 and Ubuntu 16.04 with this code.
Backport of Core PR10899
This backport was attempted once, and issues were identified with it (see D1368 for details).
However, given our change in strategy to backport as much as possible and not take code ownership
where it isn't necessary, we should re-evaluate this diff.