Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Fix unused function warning",
"packageName": "react-native-windows",
"email": "30809111+acoates-ms@users.noreply.github.com",
"dependentChangeType": "patch"
}
20 changes: 10 additions & 10 deletions vnext/Microsoft.ReactNative.Cxx/ModuleRegistration.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ struct IsReactTurboModule : std::bool_constant<ReactIsReactTurboModuleImpl(stati
INTERNAL_REACT_RECOMPOSER_4( \
(__VA_ARGS__, INTERNAL_REACT_MODULE_3_ARGS, INTERNAL_REACT_MODULE_2_ARGS, INTERNAL_REACT_MODULE_1_ARG, ))

#define INTERNAL_REACT_MODULE_NO_REGISTRATION_AND_PROVIDER( \
moduleStruct, moduleName, eventEmitterName, isReactTurboModule) \
struct moduleStruct; \
\
constexpr bool ReactIsReactTurboModuleImpl(moduleStruct *) noexcept { return isReactTurboModule; } \
\
template <class TRegistry> \
constexpr void GetReactModuleInfo(moduleStruct *, TRegistry &registry) noexcept { \
registry.RegisterModule( \
moduleName, eventEmitterName, winrt::Microsoft::ReactNative::ReactAttributeId<__COUNTER__>{}); \
#define INTERNAL_REACT_MODULE_NO_REGISTRATION_AND_PROVIDER( \
moduleStruct, moduleName, eventEmitterName, isReactTurboModule) \
struct moduleStruct; \
\
[[maybe_unused]] constexpr bool ReactIsReactTurboModuleImpl(moduleStruct *) noexcept { return isReactTurboModule; } \
\
template <class TRegistry> \
constexpr void GetReactModuleInfo(moduleStruct *, TRegistry &registry) noexcept { \
registry.RegisterModule( \
moduleName, eventEmitterName, winrt::Microsoft::ReactNative::ReactAttributeId<__COUNTER__>{}); \
}

// Another version of REACT_MODULE but does not do auto registration
Expand Down
Loading