Skip to content

Commit 0ed868c

Browse files
committed
Update grpc patch for 1.80.0
1 parent b4cd484 commit 0ed868c

File tree

1 file changed

+9
-0
lines changed
  • extension/BuildPhpExtension/patches

1 file changed

+9
-0
lines changed

extension/BuildPhpExtension/patches/grpc.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,12 @@ function CreateFolderIfMissing(path) {
1212
(Get-Content config.w32) | ForEach-Object { $_.Replace('FSO.CreateFolder', 'CreateFolderIfMissing') } | Set-Content config.w32
1313
(Get-Content config.w32) | ForEach-Object { $_ -replace '/D_WIN32_WINNT=0x600', '/D_WIN32_WINNT=0x600 /FS /std:c++17' } | Set-Content config.w32
1414
(Get-Content config.w32) | ForEach-Object { $_.Replace('ARG_WITH("grpc", "grpc support", "no");', $fn) } | Set-Content config.w32
15+
16+
$wrapperPath = "src\php\ext\grpc\php7_wrapper.h"
17+
if (Test-Path $wrapperPath) {
18+
$wrapperContent = (Get-Content $wrapperPath -Raw) -replace "`r`n", "`n"
19+
$wrapperContent = $wrapperContent.Replace('#define PHP_GRPC_CALL_FUNCTION(fci, fci_cache) ({ \', '#define PHP_GRPC_CALL_FUNCTION(fci, fci_cache) do { \')
20+
$wrapperContent = $wrapperContent.Replace(' int _res = zend_call_function(fci, fci_cache TSRMLS_CC); \', ' zend_call_function(fci, fci_cache TSRMLS_CC); \')
21+
$wrapperContent = $wrapperContent.Replace(" _res; \`n})", " } while (0)")
22+
Set-Content $wrapperPath $wrapperContent
23+
}

0 commit comments

Comments
 (0)