Commit 05140af4 authored by Andrew Weintraub's avatar Andrew Weintraub Committed by Commit Bot

Add a fix to base/numerics so that code compiles for asmjs.

Bug: pdfium:1320
Change-Id: I766c1207b42822b58ba1c142d5ae34017880fd9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1648777Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Commit-Queue: Andrew Weintraub <asweintraub@google.com>
Cr-Commit-Position: refs/heads/master@{#667254}
parent bbb682d5
...@@ -17,12 +17,15 @@ ...@@ -17,12 +17,15 @@
#include "base/numerics/safe_conversions.h" #include "base/numerics/safe_conversions.h"
#ifdef __asmjs__
// Optimized safe math instructions are incompatible with asmjs.
#define BASE_HAS_OPTIMIZED_SAFE_MATH (0)
// Where available use builtin math overflow support on Clang and GCC. // Where available use builtin math overflow support on Clang and GCC.
#if !defined(__native_client__) && \ #elif !defined(__native_client__) && \
((defined(__clang__) && \ ((defined(__clang__) && \
((__clang_major__ > 3) || \ ((__clang_major__ > 3) || \
(__clang_major__ == 3 && __clang_minor__ >= 4))) || \ (__clang_major__ == 3 && __clang_minor__ >= 4))) || \
(defined(__GNUC__) && __GNUC__ >= 5)) (defined(__GNUC__) && __GNUC__ >= 5))
#include "base/numerics/safe_math_clang_gcc_impl.h" #include "base/numerics/safe_math_clang_gcc_impl.h"
#define BASE_HAS_OPTIMIZED_SAFE_MATH (1) #define BASE_HAS_OPTIMIZED_SAFE_MATH (1)
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment