Skip to content

Commit

Permalink
OcGuardLib: Avoid undefined reference to 64-bit mul builtin on IA-32
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Nov 6, 2020
1 parent 59825b3 commit 1b280f8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Library/OcGuardLib/BitOverflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ OcOverflowMulS64 (
INT64 *Result
)
{
#if defined(OC_HAS_TYPE_GENERIC_BUILTINS)
//
// Intel 32-bit architectures do not have hardware signed 64-bit
// multiplication with overflow.
//
#if defined(OC_HAS_TYPE_GENERIC_BUILTINS) && !defined(MDE_CPU_IA32)
return __builtin_mul_overflow(A, B, Result);
#elif defined(OC_HAS_TYPE_SPECIFIC_BUILTINS)
#elif defined(OC_HAS_TYPE_SPECIFIC_BUILTINS) && !defined(MDE_CPU_IA32)
return __builtin_smulll_overflow(A, B, Result);
#else
UINT64 AU;
Expand Down

0 comments on commit 1b280f8

Please sign in to comment.