mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: @public The information we required about the exported methods were previously stored on the binary's DATA section, which didn't allow to access methods on different static libraries, or in any dynamic library at all. Instead of fetching information from all the DATA segments, this diff changes the macro in order to create a new method, that returns the required information about the original method. The module itself is registered at load time, and on the bridge initialization all the auto-generated methods are called to gather the methods' information. Test Plan: UIExplorer previously had a dependency on `RCTTest`, because it had a `TestModule` that had to be on the same library. `RCTTest` is now a dependency of `UIExplorerIntegrationTests`. So the tests themselves running should test it.
85 lines
1.7 KiB
Objective-C
85 lines
1.7 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-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.
|
|
*/
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
/**
|
|
* Make global functions usable in C++
|
|
*/
|
|
#if defined(__cplusplus)
|
|
#define RCT_EXTERN extern "C" __attribute__((visibility("default")))
|
|
#else
|
|
#define RCT_EXTERN extern __attribute__((visibility("default")))
|
|
#endif
|
|
|
|
/**
|
|
* Nullability for Xcode 6.2
|
|
*/
|
|
#if !__has_feature(nullability)
|
|
#define NS_ASSUME_NONNULL_BEGIN
|
|
#define NS_ASSUME_NONNULL_END
|
|
#define nullable
|
|
#define nonnull
|
|
#define null_unspecified
|
|
#define null_resettable
|
|
#define __nullable
|
|
#define __nonnull
|
|
#define __null_unspecified
|
|
#endif
|
|
|
|
/**
|
|
* The RCT_DEBUG macro can be used to exclude error checking and logging code
|
|
* from release builds to improve performance and reduce binary size.
|
|
*/
|
|
#ifndef RCT_DEBUG
|
|
#if DEBUG
|
|
#define RCT_DEBUG 1
|
|
#else
|
|
#define RCT_DEBUG 0
|
|
#endif
|
|
#endif
|
|
|
|
/**
|
|
* The RCT_DEV macro can be used to enable or disable development tools
|
|
* such as the debug executors, dev menu, red box, etc.
|
|
*/
|
|
#ifndef RCT_DEV
|
|
#if DEBUG
|
|
#define RCT_DEV 1
|
|
#else
|
|
#define RCT_DEV 0
|
|
#endif
|
|
#endif
|
|
|
|
#if RCT_DEV
|
|
#define RCT_IF_DEV(...) __VA_ARGS__
|
|
#else
|
|
#define RCT_IF_DEV(...)
|
|
#endif
|
|
|
|
/**
|
|
* By default, only raise an NSAssertion in debug mode
|
|
* (custom assert functions will still be called).
|
|
*/
|
|
#ifndef RCT_NSASSERT
|
|
#if RCT_DEBUG
|
|
#define RCT_NSASSERT 1
|
|
#else
|
|
#define RCT_NSASSERT 0
|
|
#endif
|
|
#endif
|
|
|
|
/**
|
|
* Concat two literals. Supports macro expansions
|
|
*
|
|
* i.e. RCT_CONCAT(foo, __FILE__)
|
|
*/
|
|
#define RCT_CONCAT2(A, B) A ## B
|
|
#define RCT_CONCAT(A, B) RCT_CONCAT2(A, B)
|