Fix undefined symbols _FBcoreLocalexxHash48 and _RCTLocalizedStringFromKey in OSS (#37838)

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

We see a linker failure in the OSS build because our header exports C-style functions (not ObjC), that Objective C will assume are C ABI, but we build them as C++ functions.

Internally these are all marked as `extern "C"`, so to not deviate I did the same here to expose these always as plain C functions.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D46671506

fbshipit-source-id: 5b3005074303763d55801c4d24ac9250b96d45ba
This commit is contained in:
Nick Gerleman
2023-06-13 08:06:24 -07:00
committed by Facebook GitHub Bot
parent b5f52216b0
commit 09d357c0df
2 changed files with 12 additions and 0 deletions
@@ -14,6 +14,10 @@
#import <React/FBXXHashUtils.h>
#ifdef __cplusplus
extern "C" {
#endif
uint64_t FBcoreLocalexxHash48(const char *input, uint64_t length, uint64_t seed);
NSString *RCTLocalizedStringFromKey(uint64_t key, NSString *defaultValue);
@@ -23,4 +27,8 @@ NSString *RCTLocalizedStringFromKey(uint64_t key, NSString *defaultValue);
#define RCTLocalizedString(string, description) \
RCTLocalizedStringFromKey(RCTLocalizedStringKey(string, description), @"" string)
#ifdef __cplusplus
}
#endif
#endif
@@ -9,6 +9,8 @@
#if !defined(WITH_FBI18N) || !(WITH_FBI18N)
extern "C" {
static NSString *FBTStringByConvertingIntegerToBase64(uint64_t number)
{
const NSUInteger base = 64;
@@ -39,4 +41,6 @@ NSString *RCTLocalizedStringFromKey(uint64_t key, NSString *defaultValue)
return [bundle localizedStringForKey:FBTStringByConvertingIntegerToBase64(key) value:defaultValue table:nil];
}
}
}
#endif