Skip to content

Commit 7f68675

Browse files
authored
[libc] Fix compilation error on targets without 128-bit int types (#97039)
See Buildbot failures: - https://lab.llvm.org/buildbot/#/builders/11/builds/743 - https://lab.llvm.org/buildbot/#/builders/182/builds/362
1 parent 1be515b commit 7f68675

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

libc/src/__support/high_precision_decimal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ class HighPrecisionDecimal {
409409
result *= 10;
410410
++cur_digit;
411411
}
412-
return result + this->should_round_up(this->decimal_point, round);
412+
return result + static_cast<unsigned int>(
413+
this->should_round_up(this->decimal_point, round));
413414
}
414415

415416
// Extra functions for testing.

libc/test/src/__support/math_extras_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ TYPED_TEST(LlvmLibcBitTest, CountZeros, UnsignedTypesNoBigInt) {
102102
}
103103

104104
using UnsignedTypes = testing::TypeList<
105-
#if defined(__SIZEOF_INT128__)
105+
#if defined(LIBC_TYPES_HAS_INT128)
106106
__uint128_t,
107107
#endif
108108
unsigned char, unsigned short, unsigned int, unsigned long,

0 commit comments

Comments
 (0)