Set more predefined macros in the doxygen config. (#55900)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55900

Doxygen incorrectly parses macros like `NS_DESIGNATED_INITIALIZER`,  `RCT_EXTERN`, `RCT_DEPRECATED`, `RCT_EXTERN_MODULE`, `API_AVAILABLE`. Setting them them as predefined empty string solves the issue.

Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D94534964

fbshipit-source-id: 57a084e58479d079d43b234e3882346c5c443a69
This commit is contained in:
Dawid Małecki authored and meta-codesync[bot] committed 2026-03-05 07:21:42 -08:00
1 parent d680d7001e
commit a6d29d0d38
5 files changed
+92 -3

No files matched your search

+15 -1
View File
@@ -2443,7 +2443,21 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = FOLLY_PACK_PUSH="" FOLLY_PACK_POP="" FOLLY_PACK_ATTR="" __attribute__(x)="" __deprecated_msg(x)="" ${PREDEFINED}
PREDEFINED = FOLLY_PACK_PUSH="" \
FOLLY_PACK_POP="" \
FOLLY_PACK_ATTR="" \
__attribute__(x)="" \
__deprecated_msg(x)="" \
NS_REQUIRES_SUPER="" \
NS_UNAVAILABLE="" \
CF_RETURNS_NOT_RETAINED="" \
NS_DESIGNATED_INITIALIZER="" \
NS_DESIGNATED_INITIALIZER="" \
RCT_EXTERN="" \
RCT_DEPRECATED="" \
RCT_EXTERN_MODULE="" \
API_AVAILABLE(x)="" \
${PREDEFINED}
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2442,7 +2442,20 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = FOLLY_PACK_PUSH="" FOLLY_PACK_POP="" FOLLY_PACK_ATTR="" __attribute__(x)="" __deprecated_msg(x)="" ${PREDEFINED}
PREDEFINED = FOLLY_PACK_PUSH="" \
FOLLY_PACK_POP="" \
FOLLY_PACK_ATTR="" \
__attribute__(x)="" \
__deprecated_msg(x)="" \
NS_REQUIRES_SUPER="" \
NS_UNAVAILABLE="" \
CF_RETURNS_NOT_RETAINED="" \
NS_DESIGNATED_INITIALIZER="" \
RCT_EXTERN="" \
RCT_DEPRECATED="" \
RCT_EXTERN_MODULE="" \
API_AVAILABLE(x)="" \
${PREDEFINED}
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2442,7 +2442,19 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = FOLLY_PACK_PUSH="" FOLLY_PACK_POP="" FOLLY_PACK_ATTR="" __attribute__(x)="" __deprecated_msg(x)=""
PREDEFINED = FOLLY_PACK_PUSH="" \
FOLLY_PACK_POP="" \
FOLLY_PACK_ATTR="" \
__attribute__(x)="" \
__deprecated_msg(x)="" \
NS_REQUIRES_SUPER="" \
NS_UNAVAILABLE="" \
CF_RETURNS_NOT_RETAINED="" \
NS_DESIGNATED_INITIALIZER="" \
RCT_EXTERN="" \
RCT_DEPRECATED="" \
RCT_EXTERN_MODULE="" \
API_AVAILABLE(x)=""
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -0,0 +1,14 @@
interface RCTTestMacros {
public @property (strong, readonly) dispatch_queue_t methodQueue;
public @property (weak, readonly) id bridge;
public virtual instancetype initWithDelegate:options:(id delegate, NSDictionary * options);
public virtual instancetype initWithName:(NSString * name);
public virtual static UIUserInterfaceStyle userInterfaceStyle();
public virtual void deprecatedMethod();
}
protocol RCTTestProtocol {
public @property (assign, readonly) NSString * name;
public virtual void normalMethod();
public virtual void requiredMethod();
}
@@ -0,0 +1,36 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
@interface RCTTestMacros
- (instancetype)initWithName:(NSString *)name NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithDelegate:(id)delegate options:(NSDictionary *)options NS_DESIGNATED_INITIALIZER;
@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue RCT_DEPRECATED;
@property (nonatomic, weak, readonly) id bridge RCT_DEPRECATED;
- (void)deprecatedMethod RCT_DEPRECATED;
+ (UIUserInterfaceStyle)userInterfaceStyle API_AVAILABLE(ios(12));
@end
RCT_EXTERN void RCTExternFunction(const char *input, NSString **output);
RCT_EXTERN NSString *RCTParseType(const char **input);
@protocol RCTTestProtocol
- (void)normalMethod;
- (void)requiredMethod NS_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly) NSString *name RCT_DEPRECATED;
@end