- Wrap Utils.h's declarations in extern "C" so Tweak.xm/JSI.mm link against the plain-C symbols Utils.m actually exports, instead of expecting C++-mangled names that don't exist (confirmed via CI: "Undefined symbols ... showErrorAlert(NSString*, NSString*)"). - Add -undefined dynamic_lookup (matching RainTweak's Makefile): JSI/Hermes symbols like jsi::JSError's typeinfo only exist in the host process's own compiled-in runtime once the tweak is actually loaded into Discord, not anywhere available to link against at build time.
20 lines
668 B
Objective-C
20 lines
668 B
Objective-C
#import <Foundation/Foundation.h>
|
|
#import <UIKit/UIKit.h>
|
|
|
|
// Utils.m is compiled as plain Objective-C (C linkage), but Tweak.xm/JSI.mm are Objective-C++.
|
|
// Without extern "C", the C++ TU expects a mangled `showErrorAlert(NSString*, NSString*)` symbol
|
|
// that Utils.m never emits, breaking the link (confirmed by an actual Theos build on CI).
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
NSURL *getPyoncordDirectory(void);
|
|
UIColor *hexToUIColor(NSString *hex);
|
|
void showErrorAlert(NSString *title, NSString *message);
|
|
|
|
/** Detects the Hermes bytecode magic header ("Herm"), as opposed to plain-text JS. */
|
|
BOOL isHermesBytecode(NSData *data);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|