diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 8386fee41b0..aa5c6a0a1cf 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -1675,6 +1675,7 @@ FILE: ../../../flutter/shell/platform/common/path_utils.h FILE: ../../../flutter/shell/platform/common/path_utils_unittests.cc FILE: ../../../flutter/shell/platform/common/platform_provided_menu.h FILE: ../../../flutter/shell/platform/common/public/flutter_export.h +FILE: ../../../flutter/shell/platform/common/public/flutter_macros.h FILE: ../../../flutter/shell/platform/common/public/flutter_messenger.h FILE: ../../../flutter/shell/platform/common/public/flutter_plugin_registrar.h FILE: ../../../flutter/shell/platform/common/public/flutter_texture_registrar.h diff --git a/engine/src/flutter/shell/platform/common/BUILD.gn b/engine/src/flutter/shell/platform/common/BUILD.gn index 24d450cdb94..571ee50765d 100644 --- a/engine/src/flutter/shell/platform/common/BUILD.gn +++ b/engine/src/flutter/shell/platform/common/BUILD.gn @@ -11,6 +11,7 @@ config("desktop_library_implementation") { _public_headers = [ "public/flutter_export.h", + "public/flutter_macros.h", "public/flutter_messenger.h", "public/flutter_plugin_registrar.h", "public/flutter_texture_registrar.h", diff --git a/engine/src/flutter/shell/platform/common/public/flutter_macros.h b/engine/src/flutter/shell/platform/common/public/flutter_macros.h new file mode 100644 index 00000000000..7b60cb488b0 --- /dev/null +++ b/engine/src/flutter/shell/platform/common/public/flutter_macros.h @@ -0,0 +1,24 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FLUTTER_SHELL_PLATFORM_COMMON_PUBLIC_FLUTTER_MACROS_H_ +#define FLUTTER_SHELL_PLATFORM_COMMON_PUBLIC_FLUTTER_MACROS_H_ + +#ifdef FLUTTER_DESKTOP_LIBRARY + +// Do not add deprecation annotations when building the library. +#define FLUTTER_DEPRECATED(message) + +#else // FLUTTER_DESKTOP_LIBRARY + +// Add deprecation warning for users of the library. +#ifdef _WIN32 +#define FLUTTER_DEPRECATED(message) __declspec(deprecated(message)) +#else +#define FLUTTER_DEPRECATED(message) __attribute__((deprecated(message))) +#endif + +#endif // FLUTTER_DESKTOP_LIBRARY + +#endif // FLUTTER_SHELL_PLATFORM_COMMON_PUBLIC_FLUTTER_MACROS_H_