Skip to content

Commit

Permalink
Update intrin.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
thesn10 authored and tritao committed Jan 2, 2021
1 parent 8451cef commit 5041fa3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions build/intrin.ps1
Original file line number Diff line number Diff line change
@@ -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."
}

0 comments on commit 5041fa3

Please sign in to comment.