From 3d7c4dc510b75e43fa6a4c8a169c90333e5e4d46 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 22 May 2016 11:36:39 -0700 Subject: [PATCH] Visual Studio Projects: Avoid compiler warnings when building pthreads The project migration process from VS2008 to VS2015 doesn't bring in project/solution wide migration compile defines that are introduced in Visual Studio Community's migration which adds _USING_V110_SDK71. This affects source modules which explicitly don't inherit project wide defines. The compile of pthread.c (in various projects) is such a case. --- Visual Studio Projects/Pre-Build-Event.cmd | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Visual Studio Projects/Pre-Build-Event.cmd b/Visual Studio Projects/Pre-Build-Event.cmd index 2d591ef7..b7f67866 100644 --- a/Visual Studio Projects/Pre-Build-Event.cmd +++ b/Visual Studio Projects/Pre-Build-Event.cmd @@ -56,16 +56,21 @@ echo. if ERRORLEVEL 1 exit /B 1 echo warning: Adding Windows XP suppport to all project files at %TIME% -echo Set objFSO = CreateObject("Scripting.FileSystemObject") >>%1.fix.vbs -echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 1) >>%1.fix.vbs -echo. >>%1.fix.vbs -echo strText = objFile.ReadAll >>%1.fix.vbs -echo objFile.Close >>%1.fix.vbs -echo strNewText = Replace(strText, "", "_xp") >>%1.fix.vbs -echo. >>%1.fix.vbs -echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 2) >>%1.fix.vbs -echo objFile.Write strNewText >>%1.fix.vbs -echo objFile.Close >>%1.fix.vbs +call :FindVCVersion _VC_VER +echo Set objFSO = CreateObject("Scripting.FileSystemObject") >>%1.fix.vbs +echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 1) >>%1.fix.vbs +echo. >>%1.fix.vbs +echo strText = objFile.ReadAll >>%1.fix.vbs +echo objFile.Close >>%1.fix.vbs +echo strText = Replace(strText, "", "_xp") >>%1.fix.vbs +echo. >>%1.fix.vbs +if %_VC_VER% GEQ 14 echo strText = Replace(strText, _>>%1.fix.vbs +if %_VC_VER% GEQ 14 echo "__CLEANUP_C", _>>%1.fix.vbs +if %_VC_VER% GEQ 14 echo "__CLEANUP_C;_USING_V110_SDK71_") _>>%1.fix.vbs +if %_VC_VER% GEQ 14 echo. >>%1.fix.vbs +echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 2) >>%1.fix.vbs +echo objFile.Write strText >>%1.fix.vbs +echo objFile.Close >>%1.fix.vbs call :_Fix_PlatformToolset %1 %1 for %%f in (*.vcxproj) do call :_Fix_PlatformToolset %1 %%f