aboutsummaryrefslogtreecommitdiff
path: root/src/common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.cpp')
-rw-r--r--src/common.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common.cpp b/src/common.cpp
index b0b1c3353..211fd4be4 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -341,7 +341,7 @@ bool sub_overflow_u64(u64 x, u64 y, u64 *result) {
}
void mul_overflow_u64(u64 x, u64 y, u64 *lo, u64 *hi) {
-#if defined(GB_COMPILER_MSVC)
+#if defined(GB_COMPILER_MSVC) && defined(GB_ARCH_64_BIT)
*lo = _umul128(x, y, hi);
#else
// URL(bill): https://stackoverflow.com/questions/25095741/how-can-i-multiply-64-bit-operands-and-get-128-bit-result-portably#25096197
@@ -697,9 +697,9 @@ isize next_pow2_isize(isize n) {
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
- if (gb_size_of(isize) == 8) {
+ #if defined(GB_ARCH_64_BIT)
n |= n >> 32;
- }
+ #endif
n++;
return n;
}