summaryrefslogtreecommitdiff
path: root/platform/ios/vendor/Fabric/FABAttributes.h
blob: c3c6238503f48d311d5fcfcb9f3a13d636542097 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
//  FABAttributes.h
//  Fabric
//
//  Created by Priyanka Joshi on 3/3/15.
//  Copyright (c) 2015 Twitter. All rights reserved.
//

#pragma once

#define FAB_UNAVAILABLE(x) __attribute__((unavailable(x)))

#if __has_feature(nullability)
    #define fab_nullable           nullable
    #define fab_nonnull            nonnull
    #define fab_null_unspecified   null_unspecified
    #define fab_null_resettable    null_resettable
    #define __fab_nullable         __nullable
    #define __fab_nonnull          __nonnull
    #define __fab_null_unspecified __null_unspecified
#else
    #define fab_nullable
    #define fab_nonnull
    #define fab_null_unspecified
    #define fab_null_resettable
    #define __fab_nullable
    #define __fab_nonnull
    #define __fab_null_unspecified
#endif

#ifndef NS_ASSUME_NONNULL_BEGIN
    #define NS_ASSUME_NONNULL_BEGIN
#endif

#ifndef NS_ASSUME_NONNULL_END
    #define NS_ASSUME_NONNULL_END
#endif


/**
 * The following macros are defined here to provide
 * backwards compatability. If you are still using
 * them you should migrate to the new versions that
 * are defined above.
 */
#define FAB_NONNULL       __fab_nonnull
#define FAB_NULLABLE      __fab_nullable
#define FAB_START_NONNULL NS_ASSUME_NONNULL_BEGIN
#define FAB_END_NONNULL   NS_ASSUME_NONNULL_END