2014-10-29 08:01:22 -07:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2014-10-29 08:01:22 -07:00
|
|
|
*
|
2018-11-29 11:35:34 -08:00
|
|
|
* This source code is licensed under the MIT license found in the LICENSE
|
|
|
|
* file in the root directory of this source tree.
|
2014-10-29 08:01:22 -07:00
|
|
|
*/
|
2016-08-02 08:07:09 -07:00
|
|
|
#pragma once
|
2014-09-18 15:15:21 -07:00
|
|
|
|
2016-07-25 06:31:32 -07:00
|
|
|
#ifdef __cplusplus
|
2016-12-03 04:40:18 -08:00
|
|
|
#define YG_EXTERN_C_BEGIN extern "C" {
|
|
|
|
#define YG_EXTERN_C_END }
|
2016-07-25 06:31:32 -07:00
|
|
|
#else
|
2016-12-03 04:40:18 -08:00
|
|
|
#define YG_EXTERN_C_BEGIN
|
|
|
|
#define YG_EXTERN_C_END
|
2016-07-25 06:31:32 -07:00
|
|
|
#endif
|
2016-08-02 08:07:11 -07:00
|
|
|
|
2016-09-22 16:22:34 -07:00
|
|
|
#ifdef _WINDLL
|
|
|
|
#define WIN_EXPORT __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define WIN_EXPORT
|
|
|
|
#endif
|
|
|
|
|
2017-01-09 08:34:56 -08:00
|
|
|
#ifdef NS_ENUM
|
2019-01-08 12:47:53 -08:00
|
|
|
// Cannot use NSInteger as NSInteger has a different size than int (which is the
|
|
|
|
// default type of a enum). Therefor when linking the Yoga C library into obj-c
|
|
|
|
// the header is a missmatch for the Yoga ABI.
|
2017-01-09 08:34:56 -08:00
|
|
|
#define YG_ENUM_BEGIN(name) NS_ENUM(int, name)
|
|
|
|
#define YG_ENUM_END(name)
|
2017-01-08 11:42:43 -08:00
|
|
|
#else
|
2017-01-09 08:34:56 -08:00
|
|
|
#define YG_ENUM_BEGIN(name) enum name
|
2017-01-08 11:42:43 -08:00
|
|
|
#define YG_ENUM_END(name) name
|
|
|
|
#endif
|
2019-05-29 07:38:12 -07:00
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define YG_DEPRECATED __attribute__((deprecated))
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
#define YG_DEPRECATED __declspec(deprecated)
|
|
|
|
#elif __cplusplus >= 201402L
|
|
|
|
#if defined(__has_cpp_attribute)
|
|
|
|
#if __has_cpp_attribute(deprecated)
|
|
|
|
#define YG_DEPRECATED [[deprecated]]
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|