Define _USE_MATH_DEFINES on Windows where needed (flutter/engine#21166)

This commit is contained in:
Chris Bracken
2020-09-15 08:37:02 -07:00
committed by GitHub
parent 95437e0371
commit d3f54773b7
7 changed files with 16 additions and 11 deletions

View File

@@ -174,6 +174,14 @@ if (enable_unittests) {
"//third_party/skia",
]
if (!defined(defines)) {
defines = []
}
if (is_win) {
# Required for M_PI and others.
defines += [ "_USE_MATH_DEFINES" ]
}
if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {
sources += [ "layers/fuchsia_layer_unittests.cc" ]

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#define _USE_MATH_DEFINES
#include "flutter/flow/matrix_decomposition.h"
#include <cmath>

View File

@@ -129,8 +129,15 @@ source_set("ui") {
"//third_party/skia",
]
if (!defined(defines)) {
defines = []
}
if (flutter_enable_skshaper) {
defines = [ "FLUTTER_ENABLE_SKSHAPER" ]
defines += [ "FLUTTER_ENABLE_SKSHAPER" ]
}
if (is_win) {
# Required for M_PI and others.
defines += [ "_USE_MATH_DEFINES" ]
}
if (is_fuchsia && flutter_enable_legacy_fuchsia_embedder) {

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#define _USE_MATH_DEFINES
#include "flutter/lib/ui/painting/canvas.h"
#include <cmath>

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#define _USE_MATH_DEFINES
#include "flutter/lib/ui/painting/gradient.h"
#include "third_party/tonic/converter/dart_converter.h"

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#define _USE_MATH_DEFINES
#include "flutter/lib/ui/painting/path.h"
#include <cmath>

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#define _USE_MATH_DEFINES
#include "flutter/lib/ui/painting/path_measure.h"
#include <cmath>