Commit c5f6231
Add Compiler Condition to use inline assembly optimizations with ARM64 for Compatibility with MSVC (#17671)
#17665
**Problem**
`google\protobuf\parse_context.h(721,10): error C2059: syntax error: ':'`
`google\protobuf\parse_context.h(898,14): error C3861: 'Ubfx7': identifier not found`
The latest protobuf versions fail to compile with MSVC on Windows ARM64 architecture.
> Inline assembly is only available for x86 targets. For similar functionality in x64 or ARM64 code, use [compiler intrinsics](https://learn.microsoft.com/en-us/cpp/intrinsics/compiler-intrinsics?view=msvc-170).
https://learn.microsoft.com/en-us/cpp/assembler/inline/writing-functions-with-inline-assembly?view=msvc-170
**Solution**
As inline assembly for win ARM64 with MSVC as a compiler is not supported (even ARM specific assembly functions), a term has been added to the conditions in parse_context.h to prevent the assembly optimizations for arm64 from executing if the compiler is MSVC.
Tested by compiling protobuf with MSVC on Windows ARM64 and AMD64 architecture. Compilation was a success.
Closes #17671
COPYBARA_INTEGRATE_REVIEW=#17671 from dsmith111:smithdavi/msvc-compatibility-patch 765f8c8
PiperOrigin-RevId: 6632627601 parent 5a22455 commit c5f6231
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
638 | | - | |
| 638 | + | |
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | | - | |
| 869 | + | |
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
| |||
0 commit comments