summaryrefslogtreecommitdiff
path: root/objective-c/include/objc/Ice/Config.h
blob: aa84d33e780e5ccc23a0c793e640222b5da61a07 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// **********************************************************************
//
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

//
// Some import files we need almost everywhere
//
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSData.h>
#import <Foundation/NSNull.h>

#import <stdlib.h>

#define ICE_DEPRECATED_API(msg) __attribute__((deprecated(msg)))
#define ICE_DECLSPEC_EXPORT __attribute__((visibility ("default")))
#define ICE_DECLSPEC_IMPORT __attribute__((visibility ("default")))

#ifndef ICE_API
#   ifdef ICE_API_EXPORTS
#       define ICE_API ICE_DECLSPEC_EXPORT
#    else
#       define ICE_API ICE_DECLSPEC_IMPORT
#    endif
#endif

//
// Don't forget to update the conversion methods from Util.h if the types below
// are changed.
//
typedef unsigned char ICEByte;
typedef short ICEShort;
typedef int ICEInt;
#if defined(__x86_64) || defined(__arm64)
typedef long ICELong;
#else
typedef long long ICELong;
#endif
typedef float ICEFloat;
typedef double ICEDouble;

#if defined(__clang__) && __has_feature(objc_arc)
#  define ICE_STRONG_QUALIFIER __strong
#  define ICE_AUTORELEASING_QUALIFIER __autoreleasing
#  define ICE_STRONG_ATTR strong
#  define ICE_AUTORELEASE(v) v
#  define ICE_RETAIN(v) v
#  define ICE_RELEASE(v)
#else
#  define ICE_STRONG_QUALIFIER
#  define ICE_AUTORELEASING_QUALIFIER
#  define ICE_STRONG_ATTR retain
#  define ICE_AUTORELEASE(v) [v autorelease]
#  define ICE_RETAIN(v) [v retain]
#  define ICE_RELEASE(v) [v release]
#endif