-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
…ity-and-generics Nullability and Generics
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// BonMot.h | ||
// Pods | ||
// BonMot | ||
// | ||
// Created by Zev Eisenberg on 7/13/15. | ||
// | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// BONChain.m | ||
// Pods | ||
// BonMot | ||
// | ||
// Created by Zev Eisenberg on 4/24/15. | ||
// | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// BONCompatibility.h | ||
// BonMot | ||
// | ||
// Created by Zev Eisenberg on 3/4/15. | ||
// | ||
|
||
// | ||
// Nullability annotation compatibility. | ||
// | ||
|
||
// clang-format off | ||
#if __has_feature(nullability) | ||
# define BONNonnull nonnull | ||
# define BONNullable nullable | ||
# define BONCNonnull __nonnull | ||
# define BONCNullable __nullable | ||
# define BON_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN | ||
# define BON_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END | ||
#else | ||
# define BONNonnull | ||
# define BONNullable | ||
# define BONCNonnull | ||
# define BONCNullable | ||
# define BON_ASSUME_NONNULL_BEGIN | ||
# define BON_ASSUME_NONNULL_END | ||
#endif | ||
|
||
// | ||
// Lightweight generics compatibility. | ||
// | ||
|
||
#if __has_feature(objc_generics) | ||
# define BONGeneric(class, ...) class<__VA_ARGS__> | ||
# define BONGenericType(type) type | ||
#else | ||
# define BONGeneric(class, ...) class | ||
# define BONGenericType(type) id | ||
#endif | ||
|
||
|
||
#define BONStringDict BONGeneric(NSDictionary, NSString *, id) | ||
#define BONStringMutableDict BONGeneric(NSMutableDictionary, NSString *, id) | ||
#define BONGenericDict BONGeneric(NSDictionary, KeyType, ObjectType) | ||
|
||
// clang-format on |