Handle Windows headers defining ERROR to 0 in log levels. (flutter/engine#6677)

This commit is contained in:
Chinmay Garde
2018-10-26 16:47:14 -07:00
committed by GitHub
parent fa4cd7045d
commit ddd0b8887a
18 changed files with 7 additions and 68 deletions

View File

@@ -7,10 +7,6 @@
#include "flutter/assets/directory_asset_bundle.h"
#include "flutter/fml/trace_event.h"
#ifdef ERROR
#undef ERROR
#endif
namespace blink {
AssetManager::AssetManager() = default;

View File

@@ -4,10 +4,6 @@
#include "flutter/flow/layers/platform_view_layer.h"
#ifdef ERROR
#undef ERROR
#endif
namespace flow {
PlatformViewLayer::PlatformViewLayer() = default;

View File

@@ -16,6 +16,13 @@ constexpr LogSeverity LOG_ERROR = 2;
constexpr LogSeverity LOG_FATAL = 3;
constexpr LogSeverity LOG_NUM_SEVERITIES = 4;
// One of the Windows headers defines ERROR to 0. This makes the token
// concatenation in FML_LOG(ERROR) to resolve to LOG_0. We define this back to
// the appropriate log level.
#ifdef _WIN32
#define LOG_0 LOG_ERROR
#endif
// LOG_DFATAL is LOG_FATAL in debug mode, ERROR in normal mode
#ifdef NDEBUG
const LogSeverity LOG_DFATAL = LOG_ERROR;

View File

@@ -17,10 +17,6 @@
#include "third_party/tonic/logging/dart_invoke.h"
#include "third_party/tonic/typed_data/uint8_list.h"
#ifdef ERROR
#undef ERROR
#endif
using tonic::DartInvoke;
using tonic::DartPersistentValue;
using tonic::ToDart;

View File

@@ -25,10 +25,6 @@ using tonic::DartInvoke;
using tonic::DartPersistentValue;
using tonic::ToDart;
#ifdef ERROR
#undef ERROR
#endif
namespace blink {
namespace {

View File

@@ -26,10 +26,6 @@
#include "third_party/tonic/scopes/dart_api_scope.h"
#include "third_party/tonic/scopes/dart_isolate_scope.h"
#ifdef ERROR
#undef ERROR
#endif
namespace blink {
std::weak_ptr<DartIsolate> DartIsolate::CreateRootIsolate(

View File

@@ -33,10 +33,6 @@
#include "third_party/tonic/scopes/dart_api_scope.h"
#include "third_party/tonic/typed_data/uint8_list.h"
#ifdef ERROR
#undef ERROR
#endif
namespace dart {
namespace observatory {

View File

@@ -12,10 +12,6 @@
#include "flutter/runtime/runtime_delegate.h"
#include "third_party/tonic/dart_message_handler.h"
#ifdef ERROR
#undef ERROR
#endif
namespace blink {
RuntimeController::RuntimeController(

View File

@@ -26,10 +26,6 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
static constexpr char kAssetChannel[] = "flutter/assets";

View File

@@ -7,10 +7,6 @@
#include "flutter/fml/make_copyable.h"
#include "flutter/runtime/dart_vm.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
IsolateConfiguration::IsolateConfiguration() = default;

View File

@@ -14,10 +14,6 @@
#include "third_party/skia/include/core/SkSurfaceCharacterization.h"
#include "third_party/skia/include/utils/SkBase64.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
Rasterizer::Rasterizer(blink::TaskRunners task_runners)

View File

@@ -31,10 +31,6 @@
#include "third_party/skia/include/core/SkGraphics.h"
#include "third_party/tonic/common/log.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
std::unique_ptr<Shell> Shell::CreateShellOnPlatformThread(

View File

@@ -24,10 +24,6 @@
#define GPU_GL_RGB565 0x8D62
#define GPU_GL_VERSION 0x1F02
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
// Default maximum number of budgeted resources in the cache.

View File

@@ -6,10 +6,6 @@
#include "flutter/fml/make_copyable.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
EmbedderEngine::EmbedderEngine(

View File

@@ -6,10 +6,6 @@
#include "flutter/shell/common/io_manager.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
EmbedderSurfaceGL::EmbedderSurfaceGL(GLDispatchTable gl_dispatch_table,

View File

@@ -7,10 +7,6 @@
#include "flutter/fml/trace_event.h"
#include "third_party/skia/include/gpu/GrContext.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
EmbedderSurfaceSoftware::EmbedderSurfaceSoftware(

View File

@@ -4,10 +4,6 @@
#include "flutter/shell/platform/embedder/platform_view_embedder.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
PlatformViewEmbedder::PlatformViewEmbedder(

View File

@@ -21,10 +21,6 @@
#include "flutter/shell/common/thread_host.h"
#include "third_party/dart/runtime/include/bin/dart_io_api.h"
#ifdef ERROR
#undef ERROR
#endif
namespace shell {
// Checks whether the engine's main Dart isolate has no pending work. If so,