YGMacros.h 818 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the LICENSE
  5. * file in the root directory of this source tree.
  6. */
  7. #pragma once
  8. #ifdef __cplusplus
  9. #define YG_EXTERN_C_BEGIN extern "C" {
  10. #define YG_EXTERN_C_END }
  11. #else
  12. #define YG_EXTERN_C_BEGIN
  13. #define YG_EXTERN_C_END
  14. #endif
  15. #ifdef _WINDLL
  16. #define WIN_EXPORT __declspec(dllexport)
  17. #else
  18. #define WIN_EXPORT
  19. #endif
  20. #ifdef NS_ENUM
  21. // Cannot use NSInteger as NSInteger has a different size than int (which is the
  22. // default type of a enum). Therefor when linking the Yoga C library into obj-c
  23. // the header is a missmatch for the Yoga ABI.
  24. #define YG_ENUM_BEGIN(name) NS_ENUM(int, name)
  25. #define YG_ENUM_END(name)
  26. #else
  27. #define YG_ENUM_BEGIN(name) enum name
  28. #define YG_ENUM_END(name) name
  29. #endif