summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2022-01-19 17:08:06 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-01-19 17:08:06 +0000
commit324d2ce21fac485a00c68a7c0a68c74bc130193e (patch)
treeb4813503577c8ba3590b19e8d5b8de8e781e2db3
parent7415528a1df22d393fbaabb7bcf4df5883d5df3e (diff)
parentaca9186ac23adce3e5f2968e125733c7de62395f (diff)
downloaddng_sdk-324d2ce21fac485a00c68a7c0a68c74bc130193e.tar.gz
Use LONG_MAX instead of __WORDSIZE to find size of long am: 42db4d19ac am: aca9186ac2
Original change: https://android-review.googlesource.com/c/platform/external/dng_sdk/+/1937957 Change-Id: Ifaf4b87e1e1018270b480bcd0daf8fd1177e5e30
-rw-r--r--source/dng_safe_arithmetic.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/dng_safe_arithmetic.h b/source/dng_safe_arithmetic.h
index b229dc4..66c5ebf 100644
--- a/source/dng_safe_arithmetic.h
+++ b/source/dng_safe_arithmetic.h
@@ -20,6 +20,7 @@
#ifndef __dng_safe_arithmetic__
#define __dng_safe_arithmetic__
+#include <climits>
#include <cstddef>
#include <cstdint>
#include <limits>
@@ -112,7 +113,7 @@ std::int64_t SafeInt64MultSlow(std::int64_t arg1, std::int64_t arg2);
#if __has_builtin(__builtin_smull_overflow)
inline std::int64_t SafeInt64MultByClang(std::int64_t arg1, std::int64_t arg2) {
std::int64_t result;
-#if (__WORDSIZE == 64) && !defined(__APPLE__)
+#if LONG_MAX == INT64_MAX
if (__builtin_smull_overflow(arg1, arg2, &result)) {
#else
if (__builtin_smulll_overflow(arg1, arg2, &result)) {