Commit 20278fde authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Consistently define OS_ASMJS and use it in place of __asmjs__.

In build/build_config.h, the #define for OS_ASMJS is inconsistent with
the surround OS_* defines. Make it consistent. Then use it in
base/numerics/safe_math_shared_impl.h instead of using __asmjs__
directly.

Change-Id: Id4605afcbdcff14fa64183eed6be46422c2e4066
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2269764Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#783676}
parent 2422445c
......@@ -16,8 +16,9 @@
#include <type_traits>
#include "base/numerics/safe_conversions.h"
#include "build/build_config.h"
#ifdef __asmjs__
#if defined(OS_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.
......
......@@ -64,7 +64,7 @@
#elif defined(_AIX)
#define OS_AIX 1
#elif defined(__asmjs__) || defined(__wasm__)
#define OS_ASMJS
#define OS_ASMJS 1
#else
#error Please add support for your platform in build/build_config.h
#endif
......
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