Skip to content

Commit

Permalink
Replace +load initializers with __attribute__((constructor)) functions (
Browse files Browse the repository at this point in the history
#1425)

* Replace +load initializers with __attribute__((constructor)) functions

* Updating the documentation for textureDidInitialize, per @nguyenhuy
  • Loading branch information
farktronix authored and Adlai-Holler committed Mar 29, 2019
1 parent 5f8161e commit 69f42db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Source/ASConfigurationDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Texture framework initialized. This method is called synchronously
* on the main thread from ASInitializeFrameworkMainThread if you defined
* AS_INITIALIZE_FRAMEWORK_MANUALLY or from the default initialization point
* (currently +load) otherwise.
* AS_INITIALIZE_FRAMEWORK_MANUALLY or otherwise from the default initialization point
* (currently a static constructor, called before main()).
*/
- (void)textureDidInitialize;

Expand Down
2 changes: 1 addition & 1 deletion Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ + (void)initialize
}

#if !AS_INITIALIZE_FRAMEWORK_MANUALLY
+ (void)load
__attribute__((constructor)) static void ASLoadFrameworkInitializer(void)
{
ASInitializeFrameworkMainThread();
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Private/ASTipsController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ @implementation ASTipsController

#pragma mark - Singleton

+ (void)load
__attribute__((constructor)) static void ASLoadTipsControllerNotification(void)
{
[NSNotificationCenter.defaultCenter addObserver:self.shared
[NSNotificationCenter.defaultCenter addObserver:ASTipsController.shared
selector:@selector(windowDidBecomeVisibleWithNotification:)
name:UIWindowDidBecomeVisibleNotification
object:nil];
Expand Down

0 comments on commit 69f42db

Please sign in to comment.