anchor.diff:  :#-----------------------------------------------------------------------------
   :# Find Microsoft Visual Studio
   
  +:# Sample paths that we want to recognize:
  +C:\Program Files (x86)\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe
  +
  +C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\amd64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin\x86_amd64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 8\VC\ce\bin\x86_arm\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 8\VC\ce\bin\x86_mips\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 8\VC\ce\bin\x86_sh\cl.exe
  +
  +C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\
  +C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\bin\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WPSDK\WP80\bin\x86_arm\cl.exe
  +
  +C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_arm\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\arm\
  +C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_arm\cl.exe
  +
  +C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_arm\cl.exe
  +
  +C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24930\bin\HostX64\x64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24930\bin\HostX64\x86\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24930\bin\HostX86\x64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24930\bin\HostX86\x86\cl.exe
  +
  +C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.24728\bin\HostX64\x64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.24728\bin\HostX64\x86\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.24728\bin\HostX86\x64\cl.exe
  +C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.24728\bin\HostX86\x86\cl.exe
  +
  +:findvs.init
  +:# Database of binary directories to search, based on VS era, P %ARCH%, Target %OS%
  +:# VS 6 to 14 era:
  +set "BIN[x86,x86]=bin"
  +set "BIN[x86,amd64]=bin\x86_amd64"
  +set "BIN[x86,arm]=bin\x86_arm"
  +set "BIN[x86,mips]=bin\x86_mips"
  +set "BIN[x86,sh]=bin\x86_sh"
  +set "BIN[x86,ia64]=bin\x86_ia64"
  +
  +set "BIN[amd64,x86]=bin\amd64_x86 bin"
  +set "BIN[amd64,amd64]=bin\amd64 bin\x86_amd64"
  +set "BIN[amd64,arm]=bin\amd64_arm bin\x86_arm"
  +
  +:# VS 15 era: More regular naming system, but much deeper
  +set "BIN15[x86,x86]=bin\HostX86\x86"
  +set "BIN15[x86,amd64]=bin\HostX86\x64"
  +set "BIN15[amd64,x86]=bin\HostX64\x86"
  +set "BIN15[amd64,amd64]=bin\HostX64\x64"
  +
  +:# Idem for native builds (There must be just one value here)
  +set "BIN[x86]=bin"
  +set "BIN[amd64]=bin\amd64"
  +set "BIN15[x86]=bin\HostX86\x86"
  +set "BIN15[amd64]=bin\HostX64\x64"
  +
  +:# Convert SysToolsLib's OS name to MSVC processor name
  +set "PROC[WIN32]=x86"	&:# SysToolsLib name
  +set "PROC[x86]=x86"	&:# VC 6+ name
  +set "PROC[WIN64]=amd64"	&:# SysToolsLib name
  +set "PROC[amd64]=amd64"	&:# VC 6 to 14 name
  +set "PROC[x64]=amd64"	&:# VC 15+ name
  +set "PROC[ARM]=arm"	&:# SysToolsLib and VC 8+ name
  +set "PROC[SH]=sh"	&:# SysToolsLib and VC 8 name
  +set "PROC[MIPS]=mips"	&:# SysToolsLib and VC 8 name
  +set "PROC[IA64]=ia64"	&:# SysToolsLib and VC 8 name
  +
  +set "VC15S=Enterprise\VC Professional\VC Community\VC"
  +exit /b
  +
   :# Find the latest Visual Studio version supporting the specified OS & architecture
  -:findvs %1=OS %2=Proc (x86|x64|amd|...) %3=VSNAME %4=VCNAME
  +:findvs %1=OS %2=Proc (x86|x64|amd|...) %3=VSVARNAME %4=VCVARNAME
   %FUNCTION0%
   set "VS=%~3"
   set "VC=%~4"
  -if /i "%~2"=="x86" (
  -  set SEARCH_IN=call :FindVsIn %~2 "bin"
  -) else if /i "%~2"=="AMD64" (
  -  if /i %ARCH%==AMD64 ( :# Do not test %PROCESSOR_ARCHITECTURE%, which is reset in recursive nmake runs
  -    set SEARCH_IN=call :FindVsIn %~2 "bin\amd64 bin\x86_amd64"
  -  ) else (
  -    set SEARCH_IN=call :FindVsIn %~2 "bin\x86_amd64"
  -  )
  -) else (
  -  if /i %ARCH%==AMD64 ( :# Do not test %PROCESSOR_ARCHITECTURE%, which is reset in recursive nmake runs
  -    set SEARCH_IN=call :FindVsIn %~2 "bin\amd64_%~2 bin\x86_%~2"
  -  ) else (
  -    set SEARCH_IN=call :FindVsIn %~2 "bin\x86_%~2"
  -  )
  -)
  -set "NEEDSHORTPATH=0"
  +call :findvs.init
  +set "SEARCH_IN=call :FindVsIn !PROC[%~1]!"
   :# If specified on the command line, and looking reasonably valid, then use it.
  -if defined VSTUDIO call :FindVsIn "%VSTUDIO%" && goto :foundvs
  +if defined VSTUDIO call :FindVsIn %2 "%VSTUDIO%" "%VC15S%" BIN15 && goto :foundvs
  +if defined VSTUDIO call :FindVsIn %2 "%VSTUDIO%" "VC VC7 VC98" BIN && goto :foundvs
   :# If VS' vcvars*.bat has already been run manually, then use it.
  -if defined VSINSTALLDIR call :FindVsIn "%VSINSTALLDIR%" && goto :foundvs
  +if defined VSINSTALLDIR call :FindVsIn %2 "%VSINSTALLDIR%" "%VC15S%" BIN15 && goto :foundvs
  +if defined VSINSTALLDIR call :FindVsIn %2 "%VSINSTALLDIR%" "VC VC7 VC98" BIN && goto :foundvs
   :# Else scan all Visual Studio versions, starting from the newest ones.
   goto :lastvs &:# Scan all Visual Studio versions
   
  
positive.code: set "%VC%.CRTINC=" &:# Path of MSVC CRT library include files, for use by MsvcLibX
  if exist "!%VC%.INCPATH!\stdio.h" set "%VC%.CRTINC=!%VC%.VCINC!" &:# Up to VS2013 it's in VC, then it's in Windows Kit UCRT
  SET "%VC%.LIBPATH=!%VC%!\lib\%PROC%"
  if /i %PROC%==x86 if not exist "!%VC%.LIBPATH!\kernel32.lib" SET "%VC%.LIBPATH=!%VC%!\lib"
  
  :# Windows SDK tools
  set TRYDIRS="!%VS%.IDE!" &:# Tools location for Visual Studio 6
  
negative.code: for %%b in (Bin Bin\WinNT WinNT) do ( :# *WinNT = Names for old VS versions with alternate versions for Win95
    if exist "!%VS%.COMMON!\Tools\%%b" SET "%VS%.TOOLS=!%VS%.COMMON!\Tools\%%b;!%VS%.TOOLS!"
  )
  
  %ECHOVARS.D% %VS%.COMMON %VS%.IDE %VS%.TOOLS
  
  %RETURN#% "%VS%=!%VS%!"
  
  