diff --git a/doc/build-windows.md b/doc/build-windows.md --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -114,7 +114,7 @@ make HOST=x86_64-w64-mingw32 cd .. ./autogen.sh # not required when building from tarball - CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/ + CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/ --with-seeder=false # seeder not supported in Windows yet make ## Building for 32-bit Windows @@ -142,7 +142,7 @@ make HOST=i686-w64-mingw32 cd .. ./autogen.sh # not required when building from tarball - CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/ + CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/ --with-seeder=false # seeder not supported in Windows yet make ## Depends system diff --git a/src/compat/setenv.h b/src/compat/setenv.h new file mode 100644 --- /dev/null +++ b/src/compat/setenv.h @@ -0,0 +1,14 @@ +#ifndef HAVE_DECL_SETENV +#define HAVE_DECL_SETENV + +#if defined(WIN32) + +#include + +int setenv(const char *name, const char *value, int overwrite) { + return _putenv_s(name, value); +} + +#endif + +#endif // HAVE_DECL_SETENV \ No newline at end of file diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -6,6 +6,8 @@ #include "config/bitcoin-config.h" #endif +#include "compat/setenv.h" + #include "bitcoinaddressvalidatortests.h" #include "chainparams.h" #include "compattests.h"