Use C++17 namespace (#41771)

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

Changelog: [Internal]

Since we are already enforcing C++20 (and 17), we can set the namespace declaration to the C++17 style

Reviewed By: NickGerleman

Differential Revision: D51789991

fbshipit-source-id: 165d7d4e652d60ab200e2355e084010a02f470a4
This commit is contained in:
Christoph Purrer
2023-12-04 19:07:51 -08:00
committed by Facebook GitHub Bot
parent 974e584891
commit b101dd0e34
15 changed files with 658 additions and 874 deletions
@@ -29,34 +29,32 @@ const ModuleTemplate = ({
RCTCxxConvertCategoryTemplate({hasteModuleName, structName: struct.name}),
)
.join('\n')}
namespace facebook {
namespace react {
${methodSerializationOutputs
.map(serializedMethodParts =>
InlineHostFunctionTemplate({
hasteModuleName,
methodName: serializedMethodParts.methodName,
returnJSType: serializedMethodParts.returnJSType,
selector: serializedMethodParts.selector,
}),
)
.join('\n')}
namespace facebook::react {
${methodSerializationOutputs
.map(serializedMethodParts =>
InlineHostFunctionTemplate({
hasteModuleName,
methodName: serializedMethodParts.methodName,
returnJSType: serializedMethodParts.returnJSType,
selector: serializedMethodParts.selector,
}),
)
.join('\n')}
${hasteModuleName}SpecJSI::${hasteModuleName}SpecJSI(const ObjCTurboModule::InitParams &params)
: ObjCTurboModule(params) {
${methodSerializationOutputs
.map(({methodName, structParamRecords, argCount}) =>
MethodMapEntryTemplate({
hasteModuleName,
methodName,
structParamRecords,
argCount,
}),
)
.join('\n' + ' '.repeat(8))}
}
} // namespace react
} // namespace facebook`;
${hasteModuleName}SpecJSI::${hasteModuleName}SpecJSI(const ObjCTurboModule::InitParams &params)
: ObjCTurboModule(params) {
${methodSerializationOutputs
.map(({methodName, structParamRecords, argCount}) =>
MethodMapEntryTemplate({
hasteModuleName,
methodName,
structParamRecords,
argCount,
}),
)
.join('\n' + ' '.repeat(8))}
}
} // namespace facebook::react`;
const RCTCxxConvertCategoryTemplate = ({
hasteModuleName,