diff options
author | Colin Cross <ccross@android.com> | 2022-01-19 17:37:18 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-01-19 17:37:18 +0000 |
commit | 4085c311f10a217a785c280e2c09d4be90383b12 (patch) | |
tree | b4813503577c8ba3590b19e8d5b8de8e781e2db3 | |
parent | 069d7c9d2df21c06df799601e2755f99bc20a8c5 (diff) | |
parent | 84e4daa16cd6bebb24e2cb6f1b5db1e8c88051a3 (diff) | |
download | dng_sdk-4085c311f10a217a785c280e2c09d4be90383b12.tar.gz |
Use LONG_MAX instead of __WORDSIZE to find size of long am: 42db4d19ac am: aca9186ac2 am: 324d2ce21f am: 84e4daa16c
Original change: https://android-review.googlesource.com/c/platform/external/dng_sdk/+/1937957
Change-Id: I20466efab0a9678b73d0f1fb27fdde3a7c79ebbb
-rw-r--r-- | source/dng_safe_arithmetic.h | 3 |
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)) { |