diff options
author | Pär Björklund <per.bjorklund@gmail.com> | 2016-04-09 14:45:41 +0200 |
---|---|---|
committer | Pär Björklund <per.bjorklund@gmail.com> | 2016-04-09 16:12:32 +0200 |
commit | 68f26a41443e8af8cb11c5059a673f3b30cc7343 (patch) | |
tree | 7c18de37f0a28f1f370dfe64d920d9deec1b0e48 | |
parent | a9cdf97565060d62114d45cf339b548ddf6cf1d6 (diff) |
This should resolve the python issues caused by vs2015 upgrade.
Fixed copying of dll during build to avoid risking using python27.dll from system32
Rebuilt all statically linked libs with _ITERATOR_DEBUG_LEVEL=0 because of performance issues, especially during video development
Curl should once again be linked against openssl
switched all projects to use /MD or /MDd because it enables sharing of env between the loaded modules making our environment hacks less needed.
Added curl and openssl to ignore list to avoid them being hooked by our crt emulation. This needs a proper fix and is likely resolved by Voyager's PR
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | lib/win32/Effects11/Effects11_2013.vcxproj | 6 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.list | 20 | ||||
-rw-r--r-- | project/VS2010Express/UnrarXLib.vcxproj | 2 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.defaults.props | 6 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj | 15 | ||||
-rw-r--r-- | project/VS2010Express/XbmcCommons.vcxproj | 2 | ||||
-rw-r--r-- | project/VS2010Express/XbmcThreads.vcxproj | 2 | ||||
-rw-r--r-- | project/VS2010Express/libPlatinum.vcxproj | 2 | ||||
-rw-r--r-- | xbmc/cores/DllLoader/Win32DllLoader.cpp | 19 | ||||
-rw-r--r-- | xbmc/interfaces/python/XBPython.cpp | 2 | ||||
-rw-r--r-- | xbmc/utils/Environment.cpp | 26 |
12 files changed, 66 insertions, 38 deletions
diff --git a/.gitignore b/.gitignore index 3c651afac1..3ce2d5f839 100644 --- a/.gitignore +++ b/.gitignore @@ -554,3 +554,5 @@ system/python27.dll system/zlib.dll lib/addons/library.kodi.inputstream/project/VS2010Express/Debug lib/addons/library.kodi.inputstream/project/VS2010Express/Release +/project/VS2010Express/XBMC for Windows.VC.db +/project/VS2010Express/XBMC for Windows.VC.VC.opendb diff --git a/lib/win32/Effects11/Effects11_2013.vcxproj b/lib/win32/Effects11/Effects11_2013.vcxproj index d0b8bfff29..3cdc19d28f 100644 --- a/lib/win32/Effects11/Effects11_2013.vcxproj +++ b/lib/win32/Effects11/Effects11_2013.vcxproj @@ -128,7 +128,7 @@ <ClCompile> <WarningLevel>Level4</WarningLevel> <Optimization>Disabled</Optimization> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <OpenMPSupport>false</OpenMPSupport> <IntrinsicFunctions>true</IntrinsicFunctions> <FloatingPointModel>Fast</FloatingPointModel> @@ -138,7 +138,7 @@ <AdditionalIncludeDirectories>.\Binary;.\Inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PrecompiledHeaderFile>pchfx.h</PrecompiledHeaderFile> <AdditionalOptions> %(AdditionalOptions)</AdditionalOptions> - <PreprocessorDefinitions>_WIN7_PLATFORM_UPDATE;WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;D3DXFX_LARGEADDRESS_HANDLE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;_WIN7_PLATFORM_UPDATE;WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;D3DXFX_LARGEADDRESS_HANDLE;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <PrecompiledHeader>Use</PrecompiledHeader> @@ -212,7 +212,7 @@ <ClCompile> <WarningLevel>Level4</WarningLevel> <Optimization>MaxSpeed</Optimization> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <OpenMPSupport>false</OpenMPSupport> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list index 6210610d7f..86b6020d85 100644 --- a/project/BuildDependencies/scripts/0_package.list +++ b/project/BuildDependencies/scripts/0_package.list @@ -7,8 +7,8 @@ ; -> ... ;PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER! bzip2-1.0.5-win32.7z -crossguid-8f399e-win32-vc140.7z -curl-7.47.1-win32-vc140.7z +crossguid-8f399e-win32-vc140-v2.7z +curl-7.48-win32-vc140.7z dnssd-541-win32.zip doxygen-1.8.2-win32.7z fontconfig-2.8.0-win32.7z @@ -22,10 +22,10 @@ libcec-3.0.0-win32-2.7z libexpat_2.0.1-win32.7z libflac-1.2.1-win32.7z libfribidi-0.19.2-win32.7z -libiconv-1.14-win32-vc140.7z +libiconv-1.14-win32-vc140-v2.7z libjpeg-turbo-1.2.0-win32.7z liblzo-2.04-win32.7z -libmicrohttpd-0.9.48-win32-vc140.7z +libmicrohttpd-0.9.48-win32-vc140-v2.7z libnfs-1.10.0-win32.7z libogg-vc100-1.2.0-win32.7z libplist-1.7-win32-3.7z @@ -39,13 +39,13 @@ libxslt-1.1.26_1-win32.7z libyajl-2.0.1-win32.7z libzlib-vc100-1.2.5-win32.7z mysql-connector-c-6.1.6-win32-vc140.7z -openssl-1.0.2e-win32-vc140.7z -pcre-8.37-win32-vc140.7z +openssl-1.0.2g-win32-vc140.7z +pcre-8.37-win32-vc140-v3.7z pillow-3.1.0-win32-vc140.7z -python-2.7.11-win32-vc140.7z +python-2.7.11-win32-vc140-v2.7z sqlite-3.10.2-win32-vc140.7z swig-2.0.7-win32-1.7z -taglib-1.10-win32-vc140.7z +taglib-1.10-win32-vc140-v2.7z texturepacker-1.1.0-win32.7z -tinyxmlstl-2.6.2-win32-vc140.7z -zlib-1.2.8-win32-vc140-v2.7z
\ No newline at end of file +tinyxmlstl-2.6.2-win32-vc140-v2.7z +zlib-1.2.8-win32-vc140-v2.7z diff --git a/project/VS2010Express/UnrarXLib.vcxproj b/project/VS2010Express/UnrarXLib.vcxproj index 35f7dde56e..fa59c1469f 100644 --- a/project/VS2010Express/UnrarXLib.vcxproj +++ b/project/VS2010Express/UnrarXLib.vcxproj @@ -62,6 +62,7 @@ <PrecompiledHeaderFile>rar.hpp</PrecompiledHeaderFile> <PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile> <DisableSpecificWarnings>4800;4018;4146;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> </ClCompile> <Lib> <OutputFile>$(TargetPath)</OutputFile> @@ -77,6 +78,7 @@ <PrecompiledHeaderFile>rar.hpp</PrecompiledHeaderFile> <PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile> <DisableSpecificWarnings>4800;4018;4146;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> </ClCompile> <Lib> <OutputFile>$(OutDir)$(ProjectName).lib</OutputFile> diff --git a/project/VS2010Express/XBMC.defaults.props b/project/VS2010Express/XBMC.defaults.props index 80f42a034c..4376ce9eb3 100644 --- a/project/VS2010Express/XBMC.defaults.props +++ b/project/VS2010Express/XBMC.defaults.props @@ -36,8 +36,8 @@ PATH=$(SolutionDir)..\Win32BuildSetup\dependencies;%PATH%</LocalDebuggerEnvironm <ClCompile> <Optimization>Disabled</Optimization> <OmitFramePointers>false</OmitFramePointers> - <PreprocessorDefinitions>_DEBUG;TARGET_WINDOWS;_WINDOWS;WIN32;_XBMC;_WIN32_WINNT=0x0600;NTDDI_VERSION=0x06000000;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <RuntimeLibrary Condition="'$(ConfigurationType)'=='Application'">MultiThreadedDebug</RuntimeLibrary> + <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;_DEBUG;TARGET_WINDOWS;_WINDOWS;WIN32;_XBMC;_WIN32_WINNT=0x0600;NTDDI_VERSION=0x06000000;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary Condition="'$(ConfigurationType)'=='Application'">MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary Condition="'$(ConfigurationType)'=='StaticLibrary'">MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary Condition="'$(ConfigurationType)'=='DynamicLibrary'">MultiThreadedDebugDLL</RuntimeLibrary> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> @@ -61,7 +61,7 @@ PATH=$(SolutionDir)..\Win32BuildSetup\dependencies;%PATH%</LocalDebuggerEnvironm <IntrinsicFunctions>true</IntrinsicFunctions> <OmitFramePointers>true</OmitFramePointers> <PreprocessorDefinitions>NDEBUG;TARGET_WINDOWS;_WINDOWS;WIN32;_XBMC;_WIN32_WINNT=0x0600;NTDDI_VERSION=0x06000000;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <RuntimeLibrary Condition="'$(ConfigurationType)'=='Application'">MultiThreaded</RuntimeLibrary> + <RuntimeLibrary Condition="'$(ConfigurationType)'=='Application'">MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary Condition="'$(ConfigurationType)'=='StaticLibrary'">MultiThreaded</RuntimeLibrary> <RuntimeLibrary Condition="'$(ConfigurationType)'=='DynamicLibrary'">MultiThreadedDLL</RuntimeLibrary> <BufferSecurityCheck>false</BufferSecurityCheck> diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index b8b9a1ce7f..7932ccd9d6 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -93,7 +93,7 @@ <AdditionalOptions>/IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions> <AdditionalDependencies>d3d11.lib;DInput8.lib;DSound.lib;winmm.lib;CrossGuidd.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;yajl.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile> - <IgnoreSpecificDefaultLibraries>libcpmt;libc;msvcrt;libcmt;msvcrtd;msvcprtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> + <IgnoreSpecificDefaultLibraries>LIBCMT.lib%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <ModuleDefinitionFile> </ModuleDefinitionFile> <DelayLoadDLLs>zlib.dll;libmysql.dll;libxslt.dll;dnssd.dll;dwmapi.dll;ssh.dll;sqlite3.dll;avcodec-57.dll;avfilter-6.dll;avformat-57.dll;avutil-55.dll;postproc-54.dll;swresample-2.dll;swscale-4.dll;d3dcompiler_47.dll;%(DelayLoadDLLs)</DelayLoadDLLs> @@ -111,7 +111,8 @@ </Manifest> <FxCompile /> <PostBuildEvent> - <Command>copy "$(WindowsSdkDir)redist\d3d\x86\D3DCompile*.DLL" "$(TargetDir)"</Command> + <Command>copy "$(WindowsSdkDir)redist\d3d\x86\D3DCompile*.DLL" "$(TargetDir)" +copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"> @@ -131,7 +132,7 @@ <OutputFile>$(OutDir)$(ProjectName)-test.exe</OutputFile> <AdditionalLibraryDirectories> </AdditionalLibraryDirectories> - <IgnoreSpecificDefaultLibraries>libc;msvcrt;libcmt;msvcrtd;msvcprtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> + <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <ModuleDefinitionFile> </ModuleDefinitionFile> <DelayLoadDLLs>libxslt.dll;dnssd.dll;dwmapi.dll;ssh.dll;sqlite3.dll;avcodec-57.dll;avfilter-6.dll;avformat-57.dll;avutil-55.dll;postproc-54.dll;swresample-2.dll;swscale-4.dll;d3dcompiler_47.dll;%(DelayLoadDLLs)</DelayLoadDLLs> @@ -149,7 +150,8 @@ </Manifest> <FxCompile /> <PostBuildEvent> - <Command>copy "$(WindowsSdkDir)redist\d3d\x86\D3DCompile*.DLL" "$(TargetDir)"</Command> + <Command>copy "$(WindowsSdkDir)redist\d3d\x86\D3DCompile*.DLL" "$(TargetDir)" +copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> @@ -167,7 +169,7 @@ <AdditionalOptions>/IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions> <AdditionalDependencies>d3d11.lib;DInput8.lib;DSound.lib;winmm.lib;CrossGuid.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;yajl.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile> - <IgnoreSpecificDefaultLibraries>libc;msvcrt;libci;msvcprt;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> + <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <DelayLoadDLLs>zlib.dll;libmysql.dll;libxslt.dll;dnssd.dll;dwmapi.dll;ssh.dll;sqlite3.dll;avcodec-57.dll;avfilter-6.dll;avformat-57.dll;avutil-55.dll;postproc-54.dll;swresample-2.dll;swscale-4.dll;d3dcompiler_47.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <GenerateDebugInformation>true</GenerateDebugInformation> <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile> @@ -182,7 +184,8 @@ </Manifest> <FxCompile /> <PostBuildEvent> - <Command>copy "$(WindowsSdkDir)redist\d3d\x86\D3DCompile*.DLL" "$(TargetDir)"</Command> + <Command>copy "$(WindowsSdkDir)redist\d3d\x86\D3DCompile*.DLL" "$(TargetDir)" +copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> diff --git a/project/VS2010Express/XbmcCommons.vcxproj b/project/VS2010Express/XbmcCommons.vcxproj index 0643b36669..93de1b3748 100644 --- a/project/VS2010Express/XbmcCommons.vcxproj +++ b/project/VS2010Express/XbmcCommons.vcxproj @@ -74,6 +74,7 @@ <AdditionalIncludeDirectories>..\..\xbmc;..\..\xbmc\win32</AdditionalIncludeDirectories> <PreprocessorDefinitions>NOMINMAX;_LIB;_USE_32BIT_TIME_T;HAS_DX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <DisableSpecificWarnings>4800;4018;4146;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> </ClCompile> <Lib /> </ItemDefinitionGroup> @@ -86,6 +87,7 @@ <DebugInformationFormat> </DebugInformationFormat> <DisableSpecificWarnings>4800;4018;4146;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> </ClCompile> <Lib /> <Lib /> diff --git a/project/VS2010Express/XbmcThreads.vcxproj b/project/VS2010Express/XbmcThreads.vcxproj index 0db38a0cb9..d5ca96604f 100644 --- a/project/VS2010Express/XbmcThreads.vcxproj +++ b/project/VS2010Express/XbmcThreads.vcxproj @@ -102,6 +102,7 @@ <PreprocessorDefinitions>NOMINMAX;_LIB;_XBMC;_USE_32BIT_TIME_T;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <DisableSpecificWarnings>4800;4018;4146;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> <ExceptionHandling>Async</ExceptionHandling> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> </ClCompile> <Lib> <OutputFile>$(TargetPath)</OutputFile> @@ -117,6 +118,7 @@ </DebugInformationFormat> <DisableSpecificWarnings>4800;4018;4146;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> <ExceptionHandling>Async</ExceptionHandling> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> </ClCompile> <Lib> <OutputFile>$(OutDir)$(ProjectName).lib</OutputFile> diff --git a/project/VS2010Express/libPlatinum.vcxproj b/project/VS2010Express/libPlatinum.vcxproj index c49784a859..d62b7ba442 100644 --- a/project/VS2010Express/libPlatinum.vcxproj +++ b/project/VS2010Express/libPlatinum.vcxproj @@ -57,6 +57,7 @@ <PrecompiledHeader> </PrecompiledHeader> <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> </ClCompile> <Lib> <OutputFile>$(OutDir)libPlatinumd.lib</OutputFile> @@ -87,6 +88,7 @@ <PrecompiledHeader> </PrecompiledHeader> <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> </ClCompile> <Lib> <OutputFile>$(OutDir)libPlatinum.lib</OutputFile> diff --git a/xbmc/cores/DllLoader/Win32DllLoader.cpp b/xbmc/cores/DllLoader/Win32DllLoader.cpp index 13b21c5e91..4d5b79904c 100644 --- a/xbmc/cores/DllLoader/Win32DllLoader.cpp +++ b/xbmc/cores/DllLoader/Win32DllLoader.cpp @@ -33,7 +33,8 @@ #include <limits> -extern "C" FILE _iob[]; +//This shouldn't be needed anymore and it's not exported through the dll +//extern "C" FILE _iob[]; extern "C" FARPROC WINAPI dllWin32GetProcAddress(HMODULE hModule, LPCSTR function); // our exports @@ -126,7 +127,7 @@ Export win32_exports[] = { "signal", -1, (void*)dll_signal, NULL }, // reading/writing from stdin/stdout needs this - { "_iob", -1, (void*)&_iob, NULL }, + //{ "_iob", -1, (void*)&_iob, NULL }, // libdvdnav + python need this (due to us using dll_putenv() to put stuff only?) { "getenv", -1, (void*)dll_getenv, NULL }, @@ -162,7 +163,7 @@ bool Win32DllLoader::Load() m_dllHandle = LoadLibraryExW(strDllW.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!m_dllHandle) { - DWORD dw = GetLastError(); + DWORD dw = GetLastError(); wchar_t* lpMsgBuf = NULL; DWORD strLen = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (LPWSTR)&lpMsgBuf, 0, NULL); if (strLen == 0) @@ -176,7 +177,7 @@ bool Win32DllLoader::Load() } else CLog::Log(LOGERROR, "%s: Failed to load \"%s\" with error %lu", __FUNCTION__, CSpecialProtocol::TranslatePath(strFileName).c_str(), dw); - + LocalFree(lpMsgBuf); return false; } @@ -353,6 +354,16 @@ bool Win32DllLoader::NeedsHooking(const char *dllName) std::string xbmcPath = CSpecialProtocol::TranslatePath("special://xbmc"); std::string homePath = CSpecialProtocol::TranslatePath("special://home"); std::string tempPath = CSpecialProtocol::TranslatePath("special://temp"); + + //need a better version of this really + //We can ignore modules we know don't need any special file access + if (StringUtils::EndsWithNoCase(dllPath, "libcurl.dll") || + StringUtils::EndsWithNoCase(dllPath, "libeay32.dll") || + StringUtils::EndsWithNoCase(dllPath, "ssleay32.dll")) + { + return false; + } + return (StringUtils::StartsWith(dllPath, xbmcPath) || StringUtils::StartsWith(dllPath, homePath) || StringUtils::StartsWith(dllPath, tempPath)); diff --git a/xbmc/interfaces/python/XBPython.cpp b/xbmc/interfaces/python/XBPython.cpp index 1b27903c65..d762bf4f8f 100644 --- a/xbmc/interfaces/python/XBPython.cpp +++ b/xbmc/interfaces/python/XBPython.cpp @@ -38,7 +38,6 @@ #include "utils/Variant.h" #include "Util.h" #ifdef TARGET_WINDOWS -#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'\"") #include "utils/Environment.h" #endif #include "settings/AdvancedSettings.h" @@ -559,7 +558,6 @@ bool XBPython::OnScriptInitialized(ILanguageInvoker *invoker) } #endif - // Darwin packs .pyo files, we need PYTHONOPTIMIZE on in order to load them. // linux built with unified builds only packages the pyo files so need it #if defined(TARGET_DARWIN) || defined(TARGET_LINUX) diff --git a/xbmc/utils/Environment.cpp b/xbmc/utils/Environment.cpp index a35e5a8aca..a3902012ca 100644 --- a/xbmc/utils/Environment.cpp +++ b/xbmc/utils/Environment.cpp @@ -21,8 +21,8 @@ /** * \file utils\Environment.cpp * \brief Implements CEnvironment class functions. - * - * Some ideas were inspired by PostgreSQL's pgwin32_putenv function. + * + * Some ideas were inspired by PostgreSQL's pgwin32_putenv function. * Refined, updated, enhanced and modified for XBMC by Karlson2k. */ @@ -36,7 +36,7 @@ #ifdef TARGET_WINDOWS -std::wstring CEnvironment::win32ConvertUtf8ToW(const std::string &text, bool *resultSuccessful /* = NULL*/) +std::wstring CEnvironment::win32ConvertUtf8ToW(const std::string &text, bool *resultSuccessful /* = NULL*/) { if (text.empty()) { @@ -65,7 +65,7 @@ std::wstring CEnvironment::win32ConvertUtf8ToW(const std::string &text, bool *re return Wret; } -std::string CEnvironment::win32ConvertWToUtf8(const std::wstring &text, bool *resultSuccessful /*= NULL*/) +std::string CEnvironment::win32ConvertWToUtf8(const std::wstring &text, bool *resultSuccessful /*= NULL*/) { if (text.empty()) { @@ -88,7 +88,7 @@ std::string CEnvironment::win32ConvertWToUtf8(const std::wstring &text, bool *re std::string ret(converted); delete[] converted; - + if (resultSuccessful != NULL) *resultSuccessful = true; return ret; @@ -102,7 +102,7 @@ typedef int (_cdecl * wputenvPtr) (const wchar_t *envstring); * \fn int CEnvironment::win32_setenv(const std::wstring &name, const std::wstring &value = L"", * updateAction action = autoDetect) * \brief Internal function used to manipulate with environment variables on win32. - * + * * This function make all dirty work with setting, deleting and modifying environment variables. * * \param name The environment variable name. @@ -155,9 +155,15 @@ int CEnvironment::win32_setenv(const std::string &name, const std::string &value #ifdef _DEBUG { L"msvcr120d.dll" },// Visual Studio 2013 (debug) #endif + { L"vcruntime140.dll" }, + { L"ucrtbase.dll" }, +#ifdef _DEBUG + { L"vcruntime140d.dll" }, + { L"ucrtbased.dll" }, +#endif { NULL } // Terminating NULL for list }; - + // Check all modules each function run, because modules can be loaded/unloaded at runtime for (int i = 0; modulesList[i]; i++) { @@ -176,10 +182,10 @@ int CEnvironment::win32_setenv(const std::string &name, const std::string &value retValue += SetEnvironmentVariableW(Wname.c_str(), NULL) ? 0 : 4; // 4 if failed else retValue += SetEnvironmentVariableW(Wname.c_str(), Wvalue.c_str()) ? 0 : 4; // 4 if failed - + // Finally update our runtime Environment retValue += (::_wputenv(EnvString.c_str()) == 0) ? 0 : 8; // 8 if failed - + return retValue; } #endif @@ -208,7 +214,7 @@ std::string CEnvironment::getenv(const std::string &name) if (wStr != NULL) return win32ConvertWToUtf8(wStr); - // Not found in Environment of runtime library + // Not found in Environment of runtime library // Try Environment of process as fallback unsigned int varSize = GetEnvironmentVariableW(Wname.c_str(), NULL, 0); if (varSize == 0) |