blob: 937b421cf9c382d88f76477ab337691260a5827c (
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
#ifndef __XMPCommonDefines_h__
#define __XMPCommonDefines_h__ 1
// =================================================================================================
// Copyright 2020 Adobe
// All Rights Reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
// of the Adobe license agreement accompanying it.
// =================================================================================================
// =================================================================================================
// XMP_CommonDefines.h - Common Defines across all the XMP Components
// ================================================================
//
// This header defines common definitions to be used across all the XMP Components.
//
// =================================================================================================
// =================================================================================================
// All Platform Settings
// ===========================
#include "XMP_Environment.h"
#if !XMP_WinBuild
#include <ciso646>
#endif
// =================================================================================================
// Macintosh Specific Settings
// ===========================
#if XMP_MacBuild
#define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
#ifdef _LIBCPP_VERSION
#define SUPPORT_SHARED_POINTERS_IN_TR1 0
#define SUPPORT_SHARED_POINTERS_IN_STD 1
#else
#define SUPPORT_SHARED_POINTERS_IN_TR1 1
#define SUPPORT_SHARED_POINTERS_IN_STD 0
#endif
#define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 0
#define BAD_EXCEPTION_SUPPORT_STRINGS 0
#define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 0
#define SUPPORT_VARIADIC_TEMPLATES 0
#define libcppNULL 0
#endif
#if XMP_AndroidBuild
#define SUPPORT_STD_ATOMIC_IMPLEMENTATION 0
#ifdef _LIBCPP_VERSION
#define SUPPORT_SHARED_POINTERS_IN_TR1 0
#define SUPPORT_SHARED_POINTERS_IN_STD 1
#define libcppNULL nullptr
#else
#define SUPPORT_SHARED_POINTERS_IN_TR1 1
#define SUPPORT_SHARED_POINTERS_IN_STD 0
#define libcppNULL NULL
#endif
#define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 0
#define BAD_EXCEPTION_SUPPORT_STRINGS 0
#define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 0
#define SUPPORT_VARIADIC_TEMPLATES 0
#endif
// =================================================================================================
// IOS Specific Settings
// ===========================
#if XMP_iOSBuild
#define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
#ifdef _LIBCPP_VERSION
#define SUPPORT_SHARED_POINTERS_IN_TR1 0
#define SUPPORT_SHARED_POINTERS_IN_STD 1
#else
#define SUPPORT_SHARED_POINTERS_IN_TR1 1
#define SUPPORT_SHARED_POINTERS_IN_STD 0
#endif
#define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 0
#define BAD_EXCEPTION_SUPPORT_STRINGS 0
#define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 0
#define SUPPORT_VARIADIC_TEMPLATES 0
#define libcppNULL 0
#endif
// =================================================================================================
// Windows Specific Settings
// =========================
#if XMP_WinBuild
#define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 1
#if _MSC_VER <= 1600
#define SUPPORT_STD_ATOMIC_IMPLEMENTATION 0
#define SUPPORT_SHARED_POINTERS_IN_TR1 1
#define SUPPORT_SHARED_POINTERS_IN_STD 0
#else
#define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
#define SUPPORT_SHARED_POINTERS_IN_TR1 0
#define SUPPORT_SHARED_POINTERS_IN_STD 1
#endif
#define BAD_EXCEPTION_SUPPORT_STRINGS 1
#define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 1
#define libcppNULL 0
#endif
// =================================================================================================
// UNIX Specific Settings
// ======================
#if XMP_UNIXBuild
# if __clang__
#define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
#else
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#if GCC_VERSION >= 40800
#define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
#else
#define REQ_FRIEND_CLASS_DECLARATION() template<typename _Ptr, std::_Lock_policy _Lp> friend class std::_Sp_counted_ptr;
#define SUPPORT_STD_ATOMIC_IMPLEMENTATION 0
#endif
#endif
#define SUPPORT_SHARED_POINTERS_IN_TR1 0
#define SUPPORT_SHARED_POINTERS_IN_STD 1
#define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 0
#define BAD_EXCEPTION_SUPPORT_STRINGS 0
#define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 1
#define SUPPORT_DYNAMIC_CAST_OPTIMIZATION 0
#define SUPPORT_VARIADIC_TEMPLATES 0
#define libcppNULL 0
#endif
#ifndef SUPPORT_VARIADIC_TEMPLATES
#define SUPPORT_VARIADIC_TEMPLATES 1
#endif
#ifndef REQ_FRIEND_CLASS_DECLARATION
#define REQ_FRIEND_CLASS_DECLARATION()
#endif
#define JOIN_CLASSNAME_WITH_VERSION_NUMBER_INT(x,y) x ## _v ## y
#define JOIN_CLASSNAME_WITH_VERSION_NUMBER(x,y) JOIN_CLASSNAME_WITH_VERSION_NUMBER_INT(x,y)
#define BASE_CLASS(classNameWithoutVersionNumber, versionNumber) JOIN_CLASSNAME_WITH_VERSION_NUMBER(classNameWithoutVersionNumber, versionNumber)
#define EXPAND_MACRO(X) X
#define QUOTEME2(X) #X
#define QUOTEME(X) QUOTEME2(X)
#define __NOTHROW__ throw()
#if SOURCE_COMPILING_XMP_ALL || SOURCE_COMPILING_XMPCORE_LIB || SOURCE_COMPILING_XMPCOMPAREANDMERGE_LIB || SOURCE_COMPILING_XMPEXTENSIONS_LIB
#define SOURCE_COMPILING_XMPCOMMON_LIB 1
#else
#define SOURCE_COMPILING_XMPCOMMON_LIB 0
#endif
#ifndef BUILDING_XMPCOMMON_LIB
#define BUILDING_XMPCOMMON_LIB 0
#endif
#if BUILDING_XMPCOMMON_LIB
#if !BUILDING_XMPCOMMON_AS_STATIC && !BUILDING_XMPCOMMON_AS_DYNAMIC
#error "Define either BUILDING_XMPCOMMON_AS_STATIC as 1 or BUILDING_XMPCOMMON_AS_DYNAMIC as 1"
#endif
#endif
#ifndef __XMP_Const_h__
#include "XMP_Const.h"
#endif
namespace AdobeXMPCommon {
typedef XMP_Int64 int64;
typedef XMP_Uns64 uint64;
typedef XMP_Int32 int32;
typedef XMP_Uns32 uint32;
#if !XMP_64
typedef uint32 sizet;
#else
typedef uint64 sizet;
#endif
const sizet kMaxSize ( ( sizet ) -1 );
const sizet npos ( kMaxSize );
// force an enum type to be represented in 32 bits
static const uint32 kMaxEnumValue ( Max_XMP_Uns32 );
static const uint32 kAllBits ( 0xFFFFFFFF );
// unique ids for the interfaces defined in the namespace
static const uint64 kIErrorID ( 0x6e4572726f722020 /* nError */ );
static const uint64 kIUTF8StringID ( 0x6e55544638537472 /* nUTF8Str */ );
static const uint64 kIObjectFactoryID ( 0x6e4f626a46616374 /* nObjFact */ );
static const uint64 kIErrorNotifierID ( 0x6e4572724e6f7466 /* nErrNotf */ );
static const uint64 kIConfigurationManagerID ( 0x6e436f6e664d6772 /* nConfMgr */ );
} // namespace AdobeXMPCommon
#endif // __XMPCommonDefines_h__
|