Skip to content

Commit

Permalink
Adding NS_REQUIRES_NIL_TERMINATION to CSMultiHandle.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddTheSane committed Feb 6, 2025
1 parent 020cfbb commit ba91641
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CSMultiFileHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}

+(CSHandle *)handleWithPathArray:(NSArray *)patharray;
+(CSHandle *)handleWithPaths:(CSHandle *)firstpath,...;
+(CSHandle *)handleWithPaths:(CSHandle *)firstpath,... NS_REQUIRES_NIL_TERMINATION;

// Initializers
-(id)initWithPaths:(NSArray *)patharray;
Expand Down
14 changes: 13 additions & 1 deletion XADTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@
#define __has_extension(...) 0
#endif

#if !defined(NS_REQUIRES_NIL_TERMINATION)
#if __has_attribute(attribute_sentinel)
#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549)
#define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel(0,1)))
#else
#define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel))
#endif
#else
#define NS_REQUIRES_NIL_TERMINATION
#endif
#endif

#ifndef NS_ENUM
#if __has_attribute(enum_extensibility)
#define __XAD_ENUM_ATTRIBUTES __attribute__((enum_extensibility(open)))
Expand Down Expand Up @@ -145,7 +157,7 @@

#ifndef API_DEPRECATED_WITH_REPLACEMENT
#if __has_attribute(attribute_deprecated_with_replacement)
#define API_DEPRECATED_WITH_REPLACEMENT(X, ...) __attribute__((deprecated("Use " #X " instead" ,X)))
#define API_DEPRECATED_WITH_REPLACEMENT(X, ...) __attribute__((deprecated("Use " #X " instead", X)))
#else
#define API_DEPRECATED_WITH_REPLACEMENT(...) DEPRECATED_ATTRIBUTE
#endif
Expand Down

0 comments on commit ba91641

Please sign in to comment.