From 5041fa328fb44e2c39d8767f90e07d89940be97f Mon Sep 17 00:00:00 2001 From: SnGmng <38666407+SnGmng@users.noreply.github.com> Date: Sat, 2 Jan 2021 16:16:58 +0100 Subject: [PATCH] Update intrin.ps1 --- build/intrin.ps1 | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/build/intrin.ps1 b/build/intrin.ps1 index 27ae958b0f..be37011f91 100644 --- a/build/intrin.ps1 +++ b/build/intrin.ps1 @@ -1,8 +1,16 @@ -$intrin = 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/include/intrin0.h' -if (!(Test-Path $intrin)) { - Write-Warning "This hack is no longer needed and should be removed." +$intrin = @( + 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/include/intrin0.h', + 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/include/intrin0.h', + 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29333/include/intrin0.h') +$patched = $false +for ($i = 0; $i -lt $intrin.Length; $i++) { + if (Test-Path $intrin[$i]) { + $content = ((Get-Content $intrin[$i]) -replace 'ifdef __clang__', 'ifdef __avoid_this_path__') + [IO.File]::WriteAllLines($intrin[$i], $content) + $patched = $true + } } -else { - $content = ((Get-Content $intrin) -replace 'ifdef __clang__', 'ifdef __avoid_this_path__') - [IO.File]::WriteAllLines($intrin, $content) + +if (!$patched) { + Write-Warning "This hack is no longer needed and should be removed." }