From 7b2361518c9eb364d3be3c7d57f3f0f0e2e5679d Mon Sep 17 00:00:00 2001 From: PaulEU Date: Thu, 5 Jun 2014 10:00:50 +0200 Subject: [PATCH] Use _putenv instead of putenv because on some Windows machines putenv doesn't work properly. --- src/crypto/openssl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/crypto/openssl.cpp b/src/crypto/openssl.cpp index cf66249..14a0b80 100644 --- a/src/crypto/openssl.cpp +++ b/src/crypto/openssl.cpp @@ -21,9 +21,13 @@ namespace fc const boost::filesystem::path& boostPath = _configurationFilePath; if(boostPath.empty() == false) { - std::string varSetting("OPENSSL_CONF="); - varSetting += _configurationFilePath.to_native_ansi_path(); - putenv((char*)varSetting.c_str()); + std::string varSetting("OPENSSL_CONF="); + varSetting += _configurationFilePath.to_native_ansi_path(); +#if defined(WIN32) + _putenv((char*)varSetting.c_str()); +#else + putenv((char*)varSetting.c_str()); +#endif } OPENSSL_config(nullptr);