FlutterMacros.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2013 The Flutter Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef FLUTTER_FLUTTERMACROS_H_
  5. #define FLUTTER_FLUTTERMACROS_H_
  6. #if defined(FLUTTER_FRAMEWORK)
  7. #define FLUTTER_EXPORT __attribute__((visibility("default")))
  8. #else // defined(FLUTTER_SDK)
  9. #define FLUTTER_EXPORT
  10. #endif // defined(FLUTTER_SDK)
  11. #ifndef NS_ASSUME_NONNULL_BEGIN
  12. #define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
  13. #define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
  14. #endif // defined(NS_ASSUME_NONNULL_BEGIN)
  15. /**
  16. * Indicates that the API has been deprecated for the specified reason. Code
  17. * that uses the deprecated API will continue to work as before. However, the
  18. * API will soon become unavailable and users are encouraged to immediately take
  19. * the appropriate action mentioned in the deprecation message and the BREAKING
  20. * CHANGES section present in the Flutter.h umbrella header.
  21. */
  22. #define FLUTTER_DEPRECATED(msg) __attribute__((__deprecated__(msg)))
  23. /**
  24. * Indicates that the previously deprecated API is now unavailable. Code that
  25. * uses the API will not work and the declaration of the API is only a stub
  26. * meant to display the given message detailing the actions for the user to take
  27. * immediately.
  28. */
  29. #define FLUTTER_UNAVAILABLE(msg) __attribute__((__unavailable__(msg)))
  30. #if __has_feature(objc_arc)
  31. #define FLUTTER_ASSERT_ARC
  32. #define FLUTTER_ASSERT_NOT_ARC #error ARC must be disabled!
  33. #else
  34. #define FLUTTER_ASSERT_ARC #error ARC must be enabled!
  35. #define FLUTTER_ASSERT_NOT_ARC
  36. #endif
  37. #endif // FLUTTER_FLUTTERMACROS_H_