Skip to content

Commit

Permalink
IGL | shell | netservice | remove hack to prevent stripping
Browse files Browse the repository at this point in the history
Summary: Use attribute instead of Obj-C to prevent dead-strip removal

Reviewed By: EricGriffith, MichaelTay

Differential Revision: D62417120

fbshipit-source-id: 2711fd64b8a504a6fb0b3ff89f6704a2dc39c82e
  • Loading branch information
Walter Luh authored and facebook-github-bot committed Sep 12, 2024
1 parent 6bd56d9 commit 88fda8d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions shell/shared/netservice/apple/NetServiceExtensionApple.mm
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,9 @@ - (void)netServiceBrowser:(NSNetServiceBrowser*)browser
}
}

IGL_API IGLShellExtension* IGLShellExtension_NewIglShellNetService() {
IGL_API __attribute((retain, used)) IGLShellExtension* IGLShellExtension_NewIglShellNetService() {
auto* extension = new NetServiceExtensionApple;
return static_cast<IGLShellExtension*>(extension);
}

} // namespace igl::shell::netservice

// TODO: Find better way to prevent stripping
@interface IglShellApple_NetServiceExtension : NSObject
@end

@implementation IglShellApple_NetServiceExtension
+ (IGLShellExtension_NewCFunction)cFunc {
return igl::shell::netservice::IGLShellExtension_NewIglShellNetService;
}
@end

0 comments on commit 88fda8d

Please sign in to comment.