2016-07-13 17:15:44 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
|
|
|
|
2016-08-02 15:07:09 +00:00
|
|
|
#pragma once
|
2016-07-13 17:15:44 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2016-08-04 15:20:11 +00:00
|
|
|
#define CSS_EXTERN_C_BEGIN extern "C" {
|
|
|
|
#define CSS_EXTERN_C_END }
|
2016-07-13 17:15:44 +00:00
|
|
|
#else
|
2016-08-04 15:20:11 +00:00
|
|
|
#define CSS_EXTERN_C_BEGIN
|
|
|
|
#define CSS_EXTERN_C_END
|
2016-07-13 17:15:44 +00:00
|
|
|
#endif
|
2016-08-02 15:07:11 +00:00
|
|
|
|
2016-09-22 23:22:34 +00:00
|
|
|
#ifdef _WINDLL
|
|
|
|
#define WIN_EXPORT __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define WIN_EXPORT
|
|
|
|
#endif
|
|
|
|
|
2016-08-02 15:07:11 +00:00
|
|
|
#ifndef FB_ASSERTIONS_ENABLED
|
|
|
|
#define FB_ASSERTIONS_ENABLED 1
|
|
|
|
#endif
|
|
|
|
|
2016-08-03 08:57:46 +00:00
|
|
|
#if FB_ASSERTIONS_ENABLED
|
|
|
|
#define CSS_ABORT() abort()
|
|
|
|
#else
|
|
|
|
#define CSS_ABORT()
|
2016-08-02 15:07:11 +00:00
|
|
|
#endif
|
|
|
|
|
2016-10-07 19:31:06 +00:00
|
|
|
#if CSS_ASSERT_FAIL_ENABLED
|
|
|
|
#define CSS_ERROR_FUNC(message) CSSAssertFail(message)
|
|
|
|
#else
|
|
|
|
#define CSS_ERROR_FUNC(message) fprintf(stderr, "%s", message)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CSS_ASSERT
|
|
|
|
#define CSS_ASSERT(X, message) \
|
|
|
|
if (!(X)) { \
|
|
|
|
CSS_ERROR_FUNC(message); \
|
|
|
|
CSS_ABORT(); \
|
2016-08-04 15:20:11 +00:00
|
|
|
}
|
2016-10-07 19:31:06 +00:00
|
|
|
#endif
|