Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions Sources/Sentry/Public/SentryDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,3 @@ typedef void (^SentryUserFeedbackConfigurationBlock)(
SentryUserFeedbackConfiguration *_Nonnull configuration);

#endif // TARGET_OS_IOS && SENTRY_HAS_UIKIT

/**
* `SENTRY_UNWRAP_NULLABLE` is used to unwrap a nullable pointer type to a non-nullable pointer type
* It should be used after the pointer has been checked for nullability.
*
* For example:
* ```objc
* id _Nullable nullablePointer = ...;
* if (nullablePointer != nil) {
* MyClass *_Nonnull nonNullPointer = SENTRY_UNWRAP_NULLABLE(MyClass, nullablePointer);
* }
* ```
*
* We use this macro instead of directly casting to be able to find all usages of this
* pattern in the codebase.
*/
#define SENTRY_UNWRAP_NULLABLE(type, nullable_var) (type *_Nonnull)(nullable_var)
1 change: 1 addition & 0 deletions Sources/Sentry/SentryArray.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "SentryArray.h"
#import "SentryDateUtils.h"
#import "SentryInternalDefines.h"
#import "SentryNSDictionarySanitize.h"

@implementation SentryArray
Expand Down
1 change: 1 addition & 0 deletions Sources/Sentry/SentryNSDataUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#endif

#import "SentryError.h"
#import "SentryInternalDefines.h"
#import "SentryNSDataUtils.h"

NS_ASSUME_NONNULL_BEGIN
Expand Down
1 change: 1 addition & 0 deletions Sources/Sentry/SentyOptionsInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#import "SentryCrashIntegration.h"
#import "SentryDsn.h"
#import "SentryFileIOTrackingIntegration.h"
#import "SentryInternalDefines.h"
#import "SentryLevelMapper.h"
#import "SentryNetworkTrackingIntegration.h"
#import "SentryOptions+Private.h"
Expand Down
17 changes: 17 additions & 0 deletions Sources/Sentry/include/SentryInternalDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,20 @@ static NSString *const SentryPlatformName = @"cocoa";
#define SPAN_DATA_BLOCKED_MAIN_THREAD @"blocked_main_thread"
#define SPAN_DATA_THREAD_ID @"thread.id"
#define SPAN_DATA_THREAD_NAME @"thread.name"

/**
* `SENTRY_UNWRAP_NULLABLE` is used to unwrap a nullable pointer type to a non-nullable pointer type
* It should be used after the pointer has been checked for nullability.
*
* For example:
* ```objc
* id _Nullable nullablePointer = ...;
* if (nullablePointer != nil) {
* MyClass *_Nonnull nonNullPointer = SENTRY_UNWRAP_NULLABLE(MyClass, nullablePointer);
* }
* ```
*
* We use this macro instead of directly casting to be able to find all usages of this
* pattern in the codebase.
*/
#define SENTRY_UNWRAP_NULLABLE(type, nullable_var) (type *_Nonnull)(nullable_var)
Loading