XMP Toolkit SDK  6.0.0
XMPCommonDefines.h
Go to the documentation of this file.
1 #ifndef __XMPCommonDefines_h__
2 #define __XMPCommonDefines_h__ 1
3 // =================================================================================================
4 // Copyright 2014 Adobe
5 // All Rights Reserved.
6 //
7 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
8 // of the Adobe license agreement accompanying it. If you have received this file from a source other
9 // than Adobe, then your use, modification, or distribution of it requires the prior written permission
10 // of Adobe.
11 // =================================================================================================
12 
13 // =================================================================================================
14 // XMP_CommonDefines.h - Common Defines across all the XMP Components
15 // ================================================================
16 //
17 // This header defines common definitions to be used across all the XMP Components.
18 //
19 // =================================================================================================
20 
21 // =================================================================================================
22 // All Platform Settings
23 // ===========================
24 #include "XMP_Environment.h"
25 #if !XMP_WinBuild
26  #include <ciso646>
27 #endif
28  // =================================================================================================
29  // Macintosh Specific Settings
30  // ===========================
31  #if XMP_MacBuild
32  #define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
33  #ifdef _LIBCPP_VERSION
34  #define SUPPORT_SHARED_POINTERS_IN_TR1 0
35  #define SUPPORT_SHARED_POINTERS_IN_STD 1
36  #else
37  #define SUPPORT_SHARED_POINTERS_IN_TR1 1
38  #define SUPPORT_SHARED_POINTERS_IN_STD 0
39  #endif
40  #define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 0
41  #define BAD_EXCEPTION_SUPPORT_STRINGS 0
42  #define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 0
43  #define SUPPORT_VARIADIC_TEMPLATES 0
44  #define libcppNULL 0
45 
46 
47  #endif
48 
49  #if XMP_AndroidBuild
50  #define SUPPORT_STD_ATOMIC_IMPLEMENTATION 0
51  #ifdef _LIBCPP_VERSION
52  #define SUPPORT_SHARED_POINTERS_IN_TR1 0
53  #define SUPPORT_SHARED_POINTERS_IN_STD 1
54  #define libcppNULL nullptr
55  #else
56  #define SUPPORT_SHARED_POINTERS_IN_TR1 1
57  #define SUPPORT_SHARED_POINTERS_IN_STD 0
58  #define libcppNULL NULL
59  #endif
60  #define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 0
61  #define BAD_EXCEPTION_SUPPORT_STRINGS 0
62  #define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 0
63  #define SUPPORT_VARIADIC_TEMPLATES 0
64 
65 
66  #endif
67 
68  // =================================================================================================
69  // IOS Specific Settings
70  // ===========================
71  #if XMP_iOSBuild
72  #define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
73  #ifdef _LIBCPP_VERSION
74  #define SUPPORT_SHARED_POINTERS_IN_TR1 0
75  #define SUPPORT_SHARED_POINTERS_IN_STD 1
76  #else
77  #define SUPPORT_SHARED_POINTERS_IN_TR1 1
78  #define SUPPORT_SHARED_POINTERS_IN_STD 0
79  #endif
80  #define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 0
81  #define BAD_EXCEPTION_SUPPORT_STRINGS 0
82  #define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 0
83  #define SUPPORT_VARIADIC_TEMPLATES 0
84  #define libcppNULL 0
85  #endif
86 
87  // =================================================================================================
88  // Windows Specific Settings
89  // =========================
90  #if XMP_WinBuild
91  #define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 1
92  #if _MSC_VER <= 1600
93  #define SUPPORT_STD_ATOMIC_IMPLEMENTATION 0
94  #define SUPPORT_SHARED_POINTERS_IN_TR1 1
95  #define SUPPORT_SHARED_POINTERS_IN_STD 0
96  #else
97  #define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
98  #define SUPPORT_SHARED_POINTERS_IN_TR1 0
99  #define SUPPORT_SHARED_POINTERS_IN_STD 1
100  #endif
101  #define BAD_EXCEPTION_SUPPORT_STRINGS 1
102  #define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 1
103  #define libcppNULL 0
104  #endif
105 
106  // =================================================================================================
107  // UNIX Specific Settings
108  // ======================
109  #if XMP_UNIXBuild
110  # if __clang__
111  #define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
112  #else
113  #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
114  #if GCC_VERSION >= 40800
115  #define SUPPORT_STD_ATOMIC_IMPLEMENTATION 1
116  #else
117  #define REQ_FRIEND_CLASS_DECLARATION() template<typename _Ptr, std::_Lock_policy _Lp> friend class std::_Sp_counted_ptr;
118  #define SUPPORT_STD_ATOMIC_IMPLEMENTATION 0
119  #endif
120  #endif
121 
122 
123  #define SUPPORT_SHARED_POINTERS_IN_TR1 0
124  #define SUPPORT_SHARED_POINTERS_IN_STD 1
125  #define SUPPORT_SHARED_POINTERS_WITH_ALLOCATORS 0
126  #define BAD_EXCEPTION_SUPPORT_STRINGS 0
127  #define VECTOR_SUPPORT_CONST_ITERATOR_FUNCTIONS 1
128  #define SUPPORT_DYNAMIC_CAST_OPTIMIZATION 0
129  #define SUPPORT_VARIADIC_TEMPLATES 0
130  #define libcppNULL 0
131  #endif
132  #ifndef SUPPORT_VARIADIC_TEMPLATES
133  #define SUPPORT_VARIADIC_TEMPLATES 1
134  #endif
135 
136  #ifndef REQ_FRIEND_CLASS_DECLARATION
137  #define REQ_FRIEND_CLASS_DECLARATION()
138  #endif
139 
140  #define JOIN_CLASSNAME_WITH_VERSION_NUMBER_INT(x,y) x ## _v ## y
141  #define JOIN_CLASSNAME_WITH_VERSION_NUMBER(x,y) JOIN_CLASSNAME_WITH_VERSION_NUMBER_INT(x,y)
142  #define BASE_CLASS(classNameWithoutVersionNumber, versionNumber) JOIN_CLASSNAME_WITH_VERSION_NUMBER(classNameWithoutVersionNumber, versionNumber)
143  #define EXPAND_MACRO(X) X
144  #define QUOTEME2(X) #X
145  #define QUOTEME(X) QUOTEME2(X)
146 
147  #define __NOTHROW__ throw()
148 
149  #if SOURCE_COMPILING_XMP_ALL || SOURCE_COMPILING_XMPCORE_LIB || SOURCE_COMPILING_XMPCOMPAREANDMERGE_LIB || SOURCE_COMPILING_XMPEXTENSIONS_LIB
150  #define SOURCE_COMPILING_XMPCOMMON_LIB 1
151  #else
152  #define SOURCE_COMPILING_XMPCOMMON_LIB 0
153  #endif
154 
155  #ifndef BUILDING_XMPCOMMON_LIB
156  #define BUILDING_XMPCOMMON_LIB 0
157  #endif
158 
159  #if BUILDING_XMPCOMMON_LIB
160  #if !BUILDING_XMPCOMMON_AS_STATIC && !BUILDING_XMPCOMMON_AS_DYNAMIC
161  #error "Define either BUILDING_XMPCOMMON_AS_STATIC as 1 or BUILDING_XMPCOMMON_AS_DYNAMIC as 1"
162  #endif
163  #endif
164 
165  #ifndef __XMP_Const_h__
166  #include "XMP_Const.h"
167  #endif
168 
169  namespace AdobeXMPCommon {
170 
171  typedef XMP_Int64 int64;
172  typedef XMP_Uns64 uint64;
173  typedef XMP_Int32 int32;
174  typedef XMP_Uns32 uint32;
175  #if !XMP_64
176  typedef uint32 sizet;
177  #else
178  typedef uint64 sizet;
179  #endif
180 
181  const sizet kMaxSize ( ( sizet ) -1 );
182  const sizet npos ( kMaxSize );
183 
184  // force an enum type to be represented in 32 bits
185  static const uint32 kMaxEnumValue ( Max_XMP_Uns32 );
186  static const uint32 kAllBits ( 0xFFFFFFFF );
187 
188  // unique ids for the interfaces defined in the namespace
189  static const uint64 kIErrorID ( 0x6e4572726f722020 /* nError */ );
190  static const uint64 kIUTF8StringID ( 0x6e55544638537472 /* nUTF8Str */ );
191  static const uint64 kIObjectFactoryID ( 0x6e4f626a46616374 /* nObjFact */ );
192  static const uint64 kIErrorNotifierID ( 0x6e4572724e6f7466 /* nErrNotf */ );
193  static const uint64 kIConfigurationManagerID ( 0x6e436f6e664d6772 /* nConfMgr */ );
194  } // namespace AdobeXMPCommon
195 
196 #endif // __XMPCommonDefines_h__
XMP_Const.h
Common C/C++ types and constants for the XMP toolkit.
XMP_Environment.h
AdobeXMPCommon::kIConfigurationManagerID
static const uint64 kIConfigurationManagerID(0x6e436f6e664d6772)
AdobeXMPCommon
Definition: IConfigurable.h:21
AdobeXMPCommon::kMaxEnumValue
static const uint32 kMaxEnumValue(Max_XMP_Uns32)
AdobeXMPCommon::npos
const sizet npos(kMaxSize)
AdobeXMPCommon::uint32
XMP_Uns32 uint32
Definition: XMPCommonDefines.h:174
AdobeXMPCommon::kIUTF8StringID
static const uint64 kIUTF8StringID(0x6e55544638537472)
AdobeXMPCommon::kIErrorID
static const uint64 kIErrorID(0x6e4572726f722020)
AdobeXMPCommon::kIObjectFactoryID
static const uint64 kIObjectFactoryID(0x6e4f626a46616374)
AdobeXMPCommon::kIErrorNotifierID
static const uint64 kIErrorNotifierID(0x6e4572724e6f7466)
AdobeXMPCommon::sizet
uint32 sizet
Definition: XMPCommonDefines.h:176
AdobeXMPCommon::int32
XMP_Int32 int32
Definition: XMPCommonDefines.h:173
Max_XMP_Uns32
static const XMP_Uns32 Max_XMP_Uns32
Definition: XMP_Const.h:123
AdobeXMPCommon::int64
XMP_Int64 int64
Definition: XMPCommonDefines.h:171
AdobeXMPCommon::uint64
XMP_Uns64 uint64
Definition: XMPCommonDefines.h:172
AdobeXMPCommon::kAllBits
static const uint32 kAllBits(0xFFFFFFFF)
AdobeXMPCommon::kMaxSize
const sizet kMaxSize((sizet) -1)