diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index 2155d24a78a26..31b4db4230b4f 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -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; diff --git a/flow/layers/platform_view_layer.cc b/flow/layers/platform_view_layer.cc index 2d4b6d295fe92..19057fbfd4b9c 100644 --- a/flow/layers/platform_view_layer.cc +++ b/flow/layers/platform_view_layer.cc @@ -4,10 +4,6 @@ #include "flutter/flow/layers/platform_view_layer.h" -#ifdef ERROR -#undef ERROR -#endif - namespace flow { PlatformViewLayer::PlatformViewLayer() = default; diff --git a/fml/log_level.h b/fml/log_level.h index 737e80db2ff68..8bed172db9ff8 100644 --- a/fml/log_level.h +++ b/fml/log_level.h @@ -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; diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 7287966c6b122..3262338d5563c 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -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; diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index b689269cf492b..be8b3f7e47b68 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -25,10 +25,6 @@ using tonic::DartInvoke; using tonic::DartPersistentValue; using tonic::ToDart; -#ifdef ERROR -#undef ERROR -#endif - namespace blink { namespace { diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 784f650f6fdb0..4eef86398afc7 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -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::CreateRootIsolate( diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 35bc542432411..c7b9b97110b8f 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -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 { diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index ace1b9b7a2183..ffc544aa10329 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -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( diff --git a/shell/common/engine.cc b/shell/common/engine.cc index f6f1553652b61..7b830a5616498 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -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"; diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc index c3bbc04c653a2..2d2323199128b 100644 --- a/shell/common/isolate_configuration.cc +++ b/shell/common/isolate_configuration.cc @@ -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; diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 47fcdf024760c..e393959bc990a 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -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) diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 178f81488a184..7fad4aef95d0e 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -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::CreateShellOnPlatformThread( diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 4a421b9dae38b..7cc8892f88ef4 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -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. diff --git a/shell/platform/embedder/embedder_engine.cc b/shell/platform/embedder/embedder_engine.cc index 1f4dc3402b72c..8c701c99bae00 100644 --- a/shell/platform/embedder/embedder_engine.cc +++ b/shell/platform/embedder/embedder_engine.cc @@ -6,10 +6,6 @@ #include "flutter/fml/make_copyable.h" -#ifdef ERROR -#undef ERROR -#endif - namespace shell { EmbedderEngine::EmbedderEngine( diff --git a/shell/platform/embedder/embedder_surface_gl.cc b/shell/platform/embedder/embedder_surface_gl.cc index 1ee37c0615564..c54978e22f37e 100644 --- a/shell/platform/embedder/embedder_surface_gl.cc +++ b/shell/platform/embedder/embedder_surface_gl.cc @@ -6,10 +6,6 @@ #include "flutter/shell/common/io_manager.h" -#ifdef ERROR -#undef ERROR -#endif - namespace shell { EmbedderSurfaceGL::EmbedderSurfaceGL(GLDispatchTable gl_dispatch_table, diff --git a/shell/platform/embedder/embedder_surface_software.cc b/shell/platform/embedder/embedder_surface_software.cc index 103257745b359..edc855b276116 100644 --- a/shell/platform/embedder/embedder_surface_software.cc +++ b/shell/platform/embedder/embedder_surface_software.cc @@ -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( diff --git a/shell/platform/embedder/platform_view_embedder.cc b/shell/platform/embedder/platform_view_embedder.cc index 07f6c8dc1ff95..47b83813d974b 100644 --- a/shell/platform/embedder/platform_view_embedder.cc +++ b/shell/platform/embedder/platform_view_embedder.cc @@ -4,10 +4,6 @@ #include "flutter/shell/platform/embedder/platform_view_embedder.h" -#ifdef ERROR -#undef ERROR -#endif - namespace shell { PlatformViewEmbedder::PlatformViewEmbedder( diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc index f8c72fad41845..4fcf7ed7f8b1c 100644 --- a/shell/testing/tester_main.cc +++ b/shell/testing/tester_main.cc @@ -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,