Nugget
eacompiler.h
1 /*-----------------------------------------------------------------------------
2  * config/eacompiler.h
3  *
4  * Copyright (c) Electronic Arts Inc. All rights reserved.
5  *-----------------------------------------------------------------------------
6  * Currently supported defines include:
7  * EA_COMPILER_GNUC
8  * EA_COMPILER_ARM
9  * EA_COMPILER_EDG
10  * EA_COMPILER_SN
11  * EA_COMPILER_MSVC
12  * EA_COMPILER_METROWERKS
13  * EA_COMPILER_INTEL
14  * EA_COMPILER_BORLANDC
15  * EA_COMPILER_IBM
16  * EA_COMPILER_QNX
17  * EA_COMPILER_GREEN_HILLS
18  * EA_COMPILER_CLANG
19  * EA_COMPILER_CLANG_CL
20  *
21  * EA_COMPILER_VERSION = <integer>
22  * EA_COMPILER_NAME = <string>
23  * EA_COMPILER_STRING = <string>
24  *
25  * EA_COMPILER_VA_COPY_REQUIRED
26  *
27  * C++98/03 functionality
28  * EA_COMPILER_NO_STATIC_CONSTANTS
29  * EA_COMPILER_NO_TEMPLATE_SPECIALIZATION
30  * EA_COMPILER_NO_TEMPLATE_PARTIAL_SPECIALIZATION
31  * EA_COMPILER_NO_MEMBER_TEMPLATES
32  * EA_COMPILER_NO_MEMBER_TEMPLATE_SPECIALIZATION
33  * EA_COMPILER_NO_TEMPLATE_TEMPLATES
34  * EA_COMPILER_NO_MEMBER_TEMPLATE_FRIENDS
35  * EA_COMPILER_NO_VOID_RETURNS
36  * EA_COMPILER_NO_COVARIANT_RETURN_TYPE
37  * EA_COMPILER_NO_DEDUCED_TYPENAME
38  * EA_COMPILER_NO_ARGUMENT_DEPENDENT_LOOKUP
39  * EA_COMPILER_NO_EXCEPTION_STD_NAMESPACE
40  * EA_COMPILER_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
41  * EA_COMPILER_NO_RTTI
42  * EA_COMPILER_NO_EXCEPTIONS
43  * EA_COMPILER_NO_NEW_THROW_SPEC
44  * EA_THROW_SPEC_NEW / EA_THROW_SPEC_DELETE
45  * EA_COMPILER_NO_UNWIND
46  * EA_COMPILER_NO_STANDARD_CPP_LIBRARY
47  * EA_COMPILER_NO_STATIC_VARIABLE_INIT
48  * EA_COMPILER_NO_STATIC_FUNCTION_INIT
49  * EA_COMPILER_NO_VARIADIC_MACROS
50  *
51  * C++11 functionality
52  * EA_COMPILER_NO_RVALUE_REFERENCES
53  * EA_COMPILER_NO_EXTERN_TEMPLATE
54  * EA_COMPILER_NO_RANGE_BASED_FOR_LOOP
55  * EA_COMPILER_NO_CONSTEXPR
56  * EA_COMPILER_NO_OVERRIDE
57  * EA_COMPILER_NO_INHERITANCE_FINAL
58  * EA_COMPILER_NO_NULLPTR
59  * EA_COMPILER_NO_AUTO
60  * EA_COMPILER_NO_DECLTYPE
61  * EA_COMPILER_NO_DEFAULTED_FUNCTIONS
62  * EA_COMPILER_NO_DELETED_FUNCTIONS
63  * EA_COMPILER_NO_LAMBDA_EXPRESSIONS
64  * EA_COMPILER_NO_TRAILING_RETURN_TYPES
65  * EA_COMPILER_NO_STRONGLY_TYPED_ENUMS
66  * EA_COMPILER_NO_FORWARD_DECLARED_ENUMS
67  * EA_COMPILER_NO_VARIADIC_TEMPLATES
68  * EA_COMPILER_NO_TEMPLATE_ALIASES
69  * EA_COMPILER_NO_INITIALIZER_LISTS
70  * EA_COMPILER_NO_NORETURN
71  * EA_COMPILER_NO_CARRIES_DEPENDENCY
72  * EA_COMPILER_NO_FALLTHROUGH
73  * EA_COMPILER_NO_NODISCARD
74  * EA_COMPILER_NO_MAYBE_UNUSED
75  * EA_COMPILER_NO_NONSTATIC_MEMBER_INITIALIZERS
76  * EA_COMPILER_NO_RIGHT_ANGLE_BRACKETS
77  * EA_COMPILER_NO_ALIGNOF
78  * EA_COMPILER_NO_ALIGNAS
79  * EA_COMPILER_NO_DELEGATING_CONSTRUCTORS
80  * EA_COMPILER_NO_INHERITING_CONSTRUCTORS
81  * EA_COMPILER_NO_USER_DEFINED_LITERALS
82  * EA_COMPILER_NO_STANDARD_LAYOUT_TYPES
83  * EA_COMPILER_NO_EXTENDED_SIZEOF
84  * EA_COMPILER_NO_INLINE_NAMESPACES
85  * EA_COMPILER_NO_UNRESTRICTED_UNIONS
86  * EA_COMPILER_NO_EXPLICIT_CONVERSION_OPERATORS
87  * EA_COMPILER_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
88  * EA_COMPILER_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
89  * EA_COMPILER_NO_NOEXCEPT
90  * EA_COMPILER_NO_RAW_LITERALS
91  * EA_COMPILER_NO_UNICODE_STRING_LITERALS
92  * EA_COMPILER_NO_NEW_CHARACTER_TYPES
93  * EA_COMPILER_NO_UNICODE_CHAR_NAME_LITERALS
94  * EA_COMPILER_NO_UNIFIED_INITIALIZATION_SYNTAX
95  * EA_COMPILER_NO_EXTENDED_FRIEND_DECLARATIONS
96  *
97  * C++14 functionality
98  * EA_COMPILER_NO_VARIABLE_TEMPLATES
99  *
100  * C++17 functionality
101  * EA_COMPILER_NO_INLINE_VARIABLES
102  * EA_COMPILER_NO_ALIGNED_NEW
103  *
104  * C++20 functionality
105  * EA_COMPILER_NO_DESIGNATED_INITIALIZERS
106  *
107  *-----------------------------------------------------------------------------
108  *
109  * Supplemental documentation
110  * EA_COMPILER_NO_STATIC_CONSTANTS
111  * Code such as this is legal, but some compilers fail to compile it:
112  * struct A{ static const a = 1; };
113  *
114  * EA_COMPILER_NO_TEMPLATE_SPECIALIZATION
115  * Some compilers fail to allow template specialization, such as with this:
116  * template<class U> void DoSomething(U u);
117  * void DoSomething(int x);
118  *
119  * EA_COMPILER_NO_TEMPLATE_PARTIAL_SPECIALIZATION
120  * Some compilers fail to allow partial template specialization, such as with this:
121  * template <class T, class Allocator> class vector{ }; // Primary templated class.
122  * template <class Allocator> class vector<bool, Allocator>{ }; // Partially specialized version.
123  *
124  * EA_COMPILER_NO_MEMBER_TEMPLATES
125  * Some compilers fail to allow member template functions such as this:
126  * struct A{ template<class U> void DoSomething(U u); };
127  *
128  * EA_COMPILER_NO_MEMBER_TEMPLATE_SPECIALIZATION
129  * Some compilers fail to allow member template specialization, such as with this:
130  * struct A{
131  * template<class U> void DoSomething(U u);
132  * void DoSomething(int x);
133  * };
134  *
135  * EA_COMPILER_NO_TEMPLATE_TEMPLATES
136  * Code such as this is legal:
137  * template<typename T, template<typename> class U>
138  * U<T> SomeFunction(const U<T> x) { return x.DoSomething(); }
139  *
140  * EA_COMPILER_NO_MEMBER_TEMPLATE_FRIENDS
141  * Some compilers fail to compile templated friends, as with this:
142  * struct A{ template<class U> friend class SomeFriend; };
143  * This is described in the C++ Standard at 14.5.3.
144  *
145  * EA_COMPILER_NO_VOID_RETURNS
146  * This is legal C++:
147  * void DoNothing1(){ };
148  * void DoNothing2(){ return DoNothing1(); }
149  *
150  * EA_COMPILER_NO_COVARIANT_RETURN_TYPE
151  * See the C++ standard sec 10.3,p5.
152  *
153  * EA_COMPILER_NO_DEDUCED_TYPENAME
154  * Some compilers don't support the use of 'typename' for
155  * dependent types in deduced contexts, as with this:
156  * template <class T> void Function(T, typename T::type);
157  *
158  * EA_COMPILER_NO_ARGUMENT_DEPENDENT_LOOKUP
159  * Also known as Koenig lookup. Basically, if you have a function
160  * that is a namespace and you call that function without prefixing
161  * it with the namespace the compiler should look at any arguments
162  * you pass to that function call and search their namespace *first*
163  * to see if the given function exists there.
164  *
165  * EA_COMPILER_NO_EXCEPTION_STD_NAMESPACE
166  * <exception> is in namespace std. Some std libraries fail to
167  * put the contents of <exception> in namespace std. The following
168  * code should normally be legal:
169  * void Function(){ std::terminate(); }
170  *
171  * EA_COMPILER_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
172  * Some compilers fail to execute DoSomething() properly, though they
173  * succeed in compiling it, as with this:
174  * template <int i>
175  * bool DoSomething(int j){ return i == j; };
176  * DoSomething<1>(2);
177  *
178  * EA_COMPILER_NO_EXCEPTIONS
179  * The compiler is configured to disallow the use of try/throw/catch
180  * syntax (often to improve performance). Use of such syntax in this
181  * case will cause a compilation error.
182  *
183  * EA_COMPILER_NO_UNWIND
184  * The compiler is configured to allow the use of try/throw/catch
185  * syntax and behaviour but disables the generation of stack unwinding
186  * code for responding to exceptions (often to improve performance).
187  *
188  *---------------------------------------------------------------------------*/
189 
190 #ifndef INCLUDED_eacompiler_H
191 #define INCLUDED_eacompiler_H
192 
193  #include <EABase/config/eaplatform.h>
194 
195  // Note: This is used to generate the EA_COMPILER_STRING macros
196  #ifndef INTERNAL_STRINGIZE
197  #define INTERNAL_STRINGIZE(x) INTERNAL_PRIMITIVE_STRINGIZE(x)
198  #endif
199  #ifndef INTERNAL_PRIMITIVE_STRINGIZE
200  #define INTERNAL_PRIMITIVE_STRINGIZE(x) #x
201  #endif
202 
203  // EA_COMPILER_HAS_FEATURE
204  #ifndef EA_COMPILER_HAS_FEATURE
205  #if defined(__clang__)
206  #define EA_COMPILER_HAS_FEATURE(x) __has_feature(x)
207  #else
208  #define EA_COMPILER_HAS_FEATURE(x) 0
209  #endif
210  #endif
211 
212 
213  // EA_COMPILER_HAS_BUILTIN
214  #ifndef EA_COMPILER_HAS_BUILTIN
215  #if defined(__clang__)
216  #define EA_COMPILER_HAS_BUILTIN(x) __has_builtin(x)
217  #else
218  #define EA_COMPILER_HAS_BUILTIN(x) 0
219  #endif
220  #endif
221 
222 
223  // EDG (EDG compiler front-end, used by other compilers such as SN)
224  #if defined(__EDG_VERSION__)
225  #define EA_COMPILER_EDG 1
226 
227  #if defined(_MSC_VER)
228  #define EA_COMPILER_EDG_VC_MODE 1
229  #endif
230  #if defined(__GNUC__)
231  #define EA_COMPILER_EDG_GCC_MODE 1
232  #endif
233  #endif
234 
235  // EA_COMPILER_WINRTCX_ENABLED
236  //
237  // Defined as 1 if the compiler has its available C++/CX support enabled, else undefined.
238  // This specifically means the corresponding compilation unit has been built with Windows Runtime
239  // Components enabled, usually via the '-ZW' compiler flags being used. This option allows for using
240  // ref counted hat-type '^' objects and other C++/CX specific keywords like "ref new"
241  #if !defined(EA_COMPILER_WINRTCX_ENABLED) && defined(__cplusplus_winrt)
242  #define EA_COMPILER_WINRTCX_ENABLED 1
243  #endif
244 
245 
246  // EA_COMPILER_CPP11_ENABLED
247  //
248  // Defined as 1 if the compiler has its available C++11 support enabled, else undefined.
249  // This does not mean that all of C++11 or any particular feature of C++11 is supported
250  // by the compiler. It means that whatever C++11 support the compiler has is enabled.
251  // This also includes existing and older compilers that still identify C++11 as C++0x.
252  //
253  // We cannot use (__cplusplus >= 201103L) alone because some compiler vendors have
254  // decided to not define __cplusplus like thus until they have fully completed their
255  // C++11 support.
256  //
257  #if !defined(EA_COMPILER_CPP11_ENABLED) && defined(__cplusplus)
258  #if (__cplusplus >= 201103L) // Clang and GCC defines this like so in C++11 mode.
259  #define EA_COMPILER_CPP11_ENABLED 1
260  #elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
261  #define EA_COMPILER_CPP11_ENABLED 1
262  #elif defined(_MSC_VER) && _MSC_VER >= 1600 // Microsoft unilaterally enables its C++11 support; there is no way to disable it.
263  #define EA_COMPILER_CPP11_ENABLED 1
264  #elif defined(__EDG_VERSION__) // && ???
265  // To do: Is there a generic way to determine this?
266  #endif
267  #endif
268 
269 
270  // EA_COMPILER_CPP14_ENABLED
271  //
272  // Defined as 1 if the compiler has its available C++14 support enabled, else undefined.
273  // This does not mean that all of C++14 or any particular feature of C++14 is supported
274  // by the compiler. It means that whatever C++14 support the compiler has is enabled.
275  //
276  // We cannot use (__cplusplus >= 201402L) alone because some compiler vendors have
277  // decided to not define __cplusplus like thus until they have fully completed their
278  // C++14 support.
279  #if !defined(EA_COMPILER_CPP14_ENABLED) && defined(__cplusplus)
280  #if (__cplusplus >= 201402L) // Clang and GCC defines this like so in C++14 mode.
281  #define EA_COMPILER_CPP14_ENABLED 1
282  #elif defined(_MSC_VER) && (_MSC_VER >= 1900) // VS2015+
283  #define EA_COMPILER_CPP14_ENABLED 1
284  #endif
285  #endif
286 
287 
288  // EA_COMPILER_CPP17_ENABLED
289  //
290  // Defined as 1 if the compiler has its available C++17 support enabled, else undefined.
291  // This does not mean that all of C++17 or any particular feature of C++17 is supported
292  // by the compiler. It means that whatever C++17 support the compiler has is enabled.
293  //
294  // We cannot use (__cplusplus >= 201703L) alone because some compiler vendors have
295  // decided to not define __cplusplus like thus until they have fully completed their
296  // C++17 support.
297  #if !defined(EA_COMPILER_CPP17_ENABLED) && defined(__cplusplus)
298  #if (__cplusplus >= 201703L)
299  #define EA_COMPILER_CPP17_ENABLED 1
300  #elif defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L) // C++17+
301  #define EA_COMPILER_CPP17_ENABLED 1
302  #endif
303  #endif
304 
305 
306  // EA_COMPILER_CPP20_ENABLED
307  //
308  // Defined as 1 if the compiler has its available C++20 support enabled, else undefined.
309  // This does not mean that all of C++20 or any particular feature of C++20 is supported
310  // by the compiler. It means that whatever C++20 support the compiler has is enabled.
311  //
312  // We cannot use (__cplusplus >= 202003L) alone because some compiler vendors have
313  // decided to not define __cplusplus like thus until they have fully completed their
314  // C++20 support.
315  #if !defined(EA_COMPILER_CPP20_ENABLED) && defined(__cplusplus)
316  // TODO(rparoin): enable once a C++20 value for the __cplusplus macro has been published
317  // #if (__cplusplus >= 202003L)
318  // #define EA_COMPILER_CPP20_ENABLED 1
319  // #elif defined(_MSVC_LANG) && (_MSVC_LANG >= 202003L) // C++20+
320  // #define EA_COMPILER_CPP20_ENABLED 1
321  // #endif
322  #endif
323 
324 
325 
326  #if defined(__ARMCC_VERSION)
327  // Note that this refers to the ARM RVCT compiler (armcc or armcpp), but there
328  // are other compilers that target ARM processors, such as GCC and Microsoft VC++.
329  // If you want to detect compiling for the ARM processor, check for EA_PROCESSOR_ARM
330  // being defined.
331  // This compiler is also identified by defined(__CC_ARM) || defined(__ARMCC__).
332  #define EA_COMPILER_RVCT 1
333  #define EA_COMPILER_ARM 1
334  #define EA_COMPILER_VERSION __ARMCC_VERSION
335  #define EA_COMPILER_NAME "RVCT"
336  //#define EA_COMPILER_STRING (defined below)
337 
338  // Clang's GCC-compatible driver.
339  #elif defined(__clang__) && !defined(_MSC_VER)
340  #define EA_COMPILER_CLANG 1
341  #define EA_COMPILER_VERSION (__clang_major__ * 100 + __clang_minor__)
342  #define EA_COMPILER_NAME "clang"
343  #define EA_COMPILER_STRING EA_COMPILER_NAME __clang_version__
344 
345  // GCC (a.k.a. GNUC)
346  #elif defined(__GNUC__) // GCC compilers exist for many platforms.
347  #define EA_COMPILER_GNUC 1
348  #define EA_COMPILER_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
349  #define EA_COMPILER_NAME "GCC"
350  #define EA_COMPILER_STRING EA_COMPILER_NAME " compiler, version " INTERNAL_STRINGIZE( __GNUC__ ) "." INTERNAL_STRINGIZE( __GNUC_MINOR__ )
351 
352  #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95) // If GCC < 2.95...
353  #define EA_COMPILER_NO_MEMBER_TEMPLATES 1
354  #endif
355  #if (__GNUC__ == 2) && (__GNUC_MINOR__ <= 97) // If GCC <= 2.97...
356  #define EA_COMPILER_NO_MEMBER_TEMPLATE_FRIENDS 1
357  #endif
358  #if (__GNUC__ == 3) && ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2)) // If GCC 3.1 or 3.2 (but not pre 3.1 or post 3.2)...
359  #define EA_COMPILER_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS 1
360  #endif
361 
362  // Borland C++
363  #elif defined(__BORLANDC__)
364  #define EA_COMPILER_BORLANDC 1
365  #define EA_COMPILER_VERSION __BORLANDC__
366  #define EA_COMPILER_NAME "Borland C"
367  //#define EA_COMPILER_STRING (defined below)
368 
369  #if (__BORLANDC__ <= 0x0550) // If Borland C++ Builder 4 and 5...
370  #define EA_COMPILER_NO_MEMBER_TEMPLATE_FRIENDS 1
371  #endif
372  #if (__BORLANDC__ >= 0x561) && (__BORLANDC__ < 0x600)
373  #define EA_COMPILER_NO_MEMBER_FUNCTION_SPECIALIZATION 1
374  #endif
375 
376 
377  // Intel C++
378  // The Intel Windows compiler masquerades as VC++ and defines _MSC_VER.
379  // The Intel compiler is based on the EDG compiler front-end.
380  #elif defined(__ICL) || defined(__ICC)
381  #define EA_COMPILER_INTEL 1
382 
383  // Should we enable the following? We probably should do so since enabling it does a lot more good than harm
384  // for users. The Intel Windows compiler does a pretty good job of emulating VC++ and so the user would likely
385  // have to handle few special cases where the Intel compiler doesn't emulate VC++ correctly.
386  #if defined(_MSC_VER)
387  #define EA_COMPILER_MSVC 1
388  #define EA_COMPILER_MICROSOFT 1
389  #endif
390 
391  // Should we enable the following? This isn't as clear because as of this writing we don't know if the Intel
392  // compiler truly emulates GCC well enough that enabling this does more good than harm.
393  #if defined(__GNUC__)
394  #define EA_COMPILER_GNUC 1
395  #endif
396 
397  #if defined(__ICL)
398  #define EA_COMPILER_VERSION __ICL
399  #elif defined(__ICC)
400  #define EA_COMPILER_VERSION __ICC
401  #endif
402  #define EA_COMPILER_NAME "Intel C++"
403  #if defined(_MSC_VER)
404  #define EA_COMPILER_STRING EA_COMPILER_NAME " compiler, version " INTERNAL_STRINGIZE( EA_COMPILER_VERSION ) ", EDG version " INTERNAL_STRINGIZE( __EDG_VERSION__ ) ", VC++ version " INTERNAL_STRINGIZE( _MSC_VER )
405  #elif defined(__GNUC__)
406  #define EA_COMPILER_STRING EA_COMPILER_NAME " compiler, version " INTERNAL_STRINGIZE( EA_COMPILER_VERSION ) ", EDG version " INTERNAL_STRINGIZE( __EDG_VERSION__ ) ", GCC version " INTERNAL_STRINGIZE( __GNUC__ )
407  #else
408  #define EA_COMPILER_STRING EA_COMPILER_NAME " compiler, version " INTERNAL_STRINGIZE( EA_COMPILER_VERSION ) ", EDG version " INTERNAL_STRINGIZE( __EDG_VERSION__ )
409  #endif
410 
411 
412  #elif defined(_MSC_VER)
413  #define EA_COMPILER_MSVC 1
414  #define EA_COMPILER_MICROSOFT 1
415  #define EA_COMPILER_VERSION _MSC_VER
416  #define EA_COMPILER_NAME "Microsoft Visual C++"
417  //#define EA_COMPILER_STRING (defined below)
418 
419  #if defined(__clang__)
420  // Clang's MSVC-compatible driver.
421  #define EA_COMPILER_CLANG_CL 1
422  #endif
423 
424  #define EA_STANDARD_LIBRARY_MSVC 1
425  #define EA_STANDARD_LIBRARY_MICROSOFT 1
426 
427  #if (_MSC_VER <= 1200) // If VC6.x and earlier...
428  #if (_MSC_VER < 1200)
429  #define EA_COMPILER_MSVCOLD 1
430  #else
431  #define EA_COMPILER_MSVC6 1
432  #endif
433 
434  #if (_MSC_VER < 1200) // If VC5.x or earlier...
435  #define EA_COMPILER_NO_TEMPLATE_SPECIALIZATION 1
436  #endif
437  #define EA_COMPILER_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS 1 // The compiler compiles this OK, but executes it wrong. Fixed in VC7.0
438  #define EA_COMPILER_NO_VOID_RETURNS 1 // The compiler fails to compile such cases. Fixed in VC7.0
439  #define EA_COMPILER_NO_EXCEPTION_STD_NAMESPACE 1 // The compiler fails to compile such cases. Fixed in VC7.0
440  #define EA_COMPILER_NO_DEDUCED_TYPENAME 1 // The compiler fails to compile such cases. Fixed in VC7.0
441  #define EA_COMPILER_NO_STATIC_CONSTANTS 1 // The compiler fails to compile such cases. Fixed in VC7.0
442  #define EA_COMPILER_NO_COVARIANT_RETURN_TYPE 1 // The compiler fails to compile such cases. Fixed in VC7.1
443  #define EA_COMPILER_NO_ARGUMENT_DEPENDENT_LOOKUP 1 // The compiler compiles this OK, but executes it wrong. Fixed in VC7.1
444  #define EA_COMPILER_NO_TEMPLATE_TEMPLATES 1 // The compiler fails to compile such cases. Fixed in VC7.1
445  #define EA_COMPILER_NO_TEMPLATE_PARTIAL_SPECIALIZATION 1 // The compiler fails to compile such cases. Fixed in VC7.1
446  #define EA_COMPILER_NO_MEMBER_TEMPLATE_FRIENDS 1 // The compiler fails to compile such cases. Fixed in VC7.1
447  //#define EA_COMPILER_NO_MEMBER_TEMPLATES 1 // VC6.x supports member templates properly 95% of the time. So do we flag the remaining 5%?
448  //#define EA_COMPILER_NO_MEMBER_TEMPLATE_SPECIALIZATION 1 // VC6.x supports member templates properly 95% of the time. So do we flag the remaining 5%?
449 
450  #elif (_MSC_VER <= 1300) // If VC7.0 and earlier...
451  #define EA_COMPILER_MSVC7 1
452 
453  #define EA_COMPILER_NO_COVARIANT_RETURN_TYPE 1 // The compiler fails to compile such cases. Fixed in VC7.1
454  #define EA_COMPILER_NO_ARGUMENT_DEPENDENT_LOOKUP 1 // The compiler compiles this OK, but executes it wrong. Fixed in VC7.1
455  #define EA_COMPILER_NO_TEMPLATE_TEMPLATES 1 // The compiler fails to compile such cases. Fixed in VC7.1
456  #define EA_COMPILER_NO_TEMPLATE_PARTIAL_SPECIALIZATION 1 // The compiler fails to compile such cases. Fixed in VC7.1
457  #define EA_COMPILER_NO_MEMBER_TEMPLATE_FRIENDS 1 // The compiler fails to compile such cases. Fixed in VC7.1
458  #define EA_COMPILER_NO_MEMBER_FUNCTION_SPECIALIZATION 1 // This is the case only for VC7.0 and not VC6 or VC7.1+. Fixed in VC7.1
459  //#define EA_COMPILER_NO_MEMBER_TEMPLATES 1 // VC7.0 supports member templates properly 95% of the time. So do we flag the remaining 5%?
460 
461  #elif (_MSC_VER < 1400) // VS2003 _MSC_VER of 1300 means VC7 (VS2003)
462  // The VC7.1 and later compiler is fairly close to the C++ standard
463  // and thus has no compiler limitations that we are concerned about.
464  #define EA_COMPILER_MSVC7_2003 1
465  #define EA_COMPILER_MSVC7_1 1
466 
467  #elif (_MSC_VER < 1500) // VS2005 _MSC_VER of 1400 means VC8 (VS2005)
468  #define EA_COMPILER_MSVC8_2005 1
469  #define EA_COMPILER_MSVC8_0 1
470 
471  #elif (_MSC_VER < 1600) // VS2008. _MSC_VER of 1500 means VC9 (VS2008)
472  #define EA_COMPILER_MSVC9_2008 1
473  #define EA_COMPILER_MSVC9_0 1
474 
475  #elif (_MSC_VER < 1700) // VS2010 _MSC_VER of 1600 means VC10 (VS2010)
476  #define EA_COMPILER_MSVC_2010 1
477  #define EA_COMPILER_MSVC10_0 1
478 
479  #elif (_MSC_VER < 1800) // VS2012 _MSC_VER of 1700 means VS2011/VS2012
480  #define EA_COMPILER_MSVC_2011 1 // Microsoft changed the name to VS2012 before shipping, despite referring to it as VS2011 up to just a few weeks before shipping.
481  #define EA_COMPILER_MSVC11_0 1
482  #define EA_COMPILER_MSVC_2012 1
483  #define EA_COMPILER_MSVC12_0 1
484 
485  #elif (_MSC_VER < 1900) // VS2013 _MSC_VER of 1800 means VS2013
486  #define EA_COMPILER_MSVC_2013 1
487  #define EA_COMPILER_MSVC13_0 1
488 
489  #elif (_MSC_VER < 1910) // VS2015 _MSC_VER of 1900 means VS2015
490  #define EA_COMPILER_MSVC_2015 1
491  #define EA_COMPILER_MSVC14_0 1
492 
493  #elif (_MSC_VER < 1911) // VS2017 _MSC_VER of 1910 means VS2017
494  #define EA_COMPILER_MSVC_2017 1
495  #define EA_COMPILER_MSVC15_0 1
496 
497  #endif
498 
499 
500  // IBM
501  #elif defined(__xlC__)
502  #define EA_COMPILER_IBM 1
503  #define EA_COMPILER_NAME "IBM XL C"
504  #define EA_COMPILER_VERSION __xlC__
505  #define EA_COMPILER_STRING "IBM XL C compiler, version " INTERNAL_STRINGIZE( __xlC__ )
506 
507  // Unknown
508  #else // Else the compiler is unknown
509 
510  #define EA_COMPILER_VERSION 0
511  #define EA_COMPILER_NAME "Unknown"
512 
513  #endif
514 
515  #ifndef EA_COMPILER_STRING
516  #define EA_COMPILER_STRING EA_COMPILER_NAME " compiler, version " INTERNAL_STRINGIZE(EA_COMPILER_VERSION)
517  #endif
518 
519 
520  // Deprecated definitions
521  // For backwards compatibility, should be supported for at least the life of EABase v2.0.x.
522  #ifndef EA_COMPILER_NO_TEMPLATE_PARTIAL_SPECIALIZATION
523  #define EA_COMPILER_PARTIAL_TEMPLATE_SPECIALIZATION 1
524  #endif
525  #ifndef EA_COMPILER_NO_TEMPLATE_SPECIALIZATION
526  #define EA_COMPILER_TEMPLATE_SPECIALIZATION 1
527  #endif
528  #ifndef EA_COMPILER_NO_MEMBER_TEMPLATES
529  #define EA_COMPILER_MEMBER_TEMPLATES 1
530  #endif
531  #ifndef EA_COMPILER_NO_MEMBER_TEMPLATE_SPECIALIZATION
532  #define EA_COMPILER_MEMBER_TEMPLATE_SPECIALIZATION 1
533  #endif
534 
535 
536 
538  // EA_COMPILER_VA_COPY_REQUIRED
539  //
540  // Defines whether va_copy must be used to copy or save va_list objects between uses.
541  // Some compilers on some platforms implement va_list whereby its contents
542  // are destroyed upon usage, even if passed by value to another function.
543  // With these compilers you can use va_copy to save and restore a va_list.
544  // Known compiler/platforms that destroy va_list contents upon usage include:
545  // CodeWarrior on PowerPC
546  // GCC on x86-64
547  // However, va_copy is part of the C99 standard and not part of earlier C and
548  // C++ standards. So not all compilers support it. VC++ doesn't support va_copy,
549  // but it turns out that VC++ doesn't usually need it on the platforms it supports,
550  // and va_copy can usually be implemented via memcpy(va_list, va_list) with VC++.
552 
553  #ifndef EA_COMPILER_VA_COPY_REQUIRED
554  #if ((defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__clang__)) && (!defined(__i386__) || defined(__x86_64__)) && !defined(__ppc__) && !defined(__PPC__) && !defined(__PPC64__)
555  #define EA_COMPILER_VA_COPY_REQUIRED 1
556  #endif
557  #endif
558 
559 
560  // EA_COMPILER_NO_RTTI
561  //
562  // If EA_COMPILER_NO_RTTI is defined, then RTTI (run-time type information)
563  // is not available (possibly due to being disabled by the user).
564  //
565  #if defined(__EDG_VERSION__) && !defined(__RTTI)
566  #define EA_COMPILER_NO_RTTI 1
567  #elif defined(__clang__) && !EA_COMPILER_HAS_FEATURE(cxx_rtti)
568  #define EA_COMPILER_NO_RTTI 1
569  #elif defined(__IBMCPP__) && !defined(__RTTI_ALL__)
570  #define EA_COMPILER_NO_RTTI 1
571  #elif defined(__GXX_ABI_VERSION) && !defined(__GXX_RTTI)
572  #define EA_COMPILER_NO_RTTI 1
573  #elif defined(_MSC_VER) && !defined(_CPPRTTI)
574  #define EA_COMPILER_NO_RTTI 1
575  #elif defined(__ARMCC_VERSION) && defined(__TARGET_CPU_MPCORE) && !defined(__RTTI)
576  #define EA_COMPILER_NO_RTTI 1
577  #endif
578 
579 
580 
581  // EA_COMPILER_NO_EXCEPTIONS / EA_COMPILER_NO_UNWIND
582  //
583  // If EA_COMPILER_NO_EXCEPTIONS is defined, then the compiler is
584  // configured to not recognize C++ exception-handling statements
585  // such as try/catch/throw. Thus, when EA_COMPILER_NO_EXCEPTIONS is
586  // defined, code that attempts to use exception handling statements
587  // will usually cause a compilation error. If is often desirable
588  // for projects to disable exception handling because exception
589  // handling causes extra code and/or data generation which might
590  // not be needed, especially if it is known that exceptions won't
591  // be happening. When writing code that is to be portable between
592  // systems of which some enable exception handling while others
593  // don't, check for EA_COMPILER_NO_EXCEPTIONS being defined.
594  //
595  #if !defined(EA_COMPILER_NO_EXCEPTIONS) && !defined(EA_COMPILER_NO_UNWIND)
596  #if defined(EA_COMPILER_GNUC) && defined(_NO_EX) // GCC on some platforms defines _NO_EX when exceptions are disabled.
597  #define EA_COMPILER_NO_EXCEPTIONS 1
598 
599  #elif (defined(EA_COMPILER_CLANG) || defined(EA_COMPILER_GNUC) || defined(EA_COMPILER_INTEL) || defined(EA_COMPILER_RVCT)) && !defined(__EXCEPTIONS) // GCC and most EDG-based compilers define __EXCEPTIONS when exception handling is enabled.
600  #define EA_COMPILER_NO_EXCEPTIONS 1
601 
602  #elif (defined(EA_COMPILER_MSVC)) && !defined(_CPPUNWIND)
603  #define EA_COMPILER_NO_UNWIND 1
604 
605  #endif // EA_COMPILER_NO_EXCEPTIONS / EA_COMPILER_NO_UNWIND
606  #endif // !defined(EA_COMPILER_NO_EXCEPTIONS) && !defined(EA_COMPILER_NO_UNWIND)
607 
608 
609  // ------------------------------------------------------------------------
610  // EA_DISABLE_ALL_VC_WARNINGS / EA_RESTORE_ALL_VC_WARNINGS
611  //
612  // Disable and re-enable all warning(s) within code.
613  //
614  // Example usage:
615  // EA_DISABLE_ALL_VC_WARNINGS()
616  // <code>
617  // EA_RESTORE_ALL_VC_WARNINGS()
618  //
619  //This is duplicated from EABase's eacompilertraits.h
620  #ifndef EA_DISABLE_ALL_VC_WARNINGS
621  #if defined(_MSC_VER)
622  #define EA_DISABLE_ALL_VC_WARNINGS() \
623  __pragma(warning(push, 0)) \
624  __pragma(warning(disable: 4244 4265 4267 4350 4472 4509 4548 4623 4710 4985 6320 4755 4625 4626 4702)) // Some warnings need to be explicitly called out.
625  #else
626  #define EA_DISABLE_ALL_VC_WARNINGS()
627  #endif
628  #endif
629 
630  //This is duplicated from EABase's eacompilertraits.h
631  #ifndef EA_RESTORE_ALL_VC_WARNINGS
632  #if defined(_MSC_VER)
633  #define EA_RESTORE_ALL_VC_WARNINGS() \
634  __pragma(warning(pop))
635  #else
636  #define EA_RESTORE_ALL_VC_WARNINGS()
637  #endif
638  #endif
639 
640  // Dinkumware
641  //This is duplicated from EABase's eahave.h
642  #if !defined(EA_HAVE_DINKUMWARE_CPP_LIBRARY) && !defined(EA_NO_HAVE_DINKUMWARE_CPP_LIBRARY)
643  #if defined(__cplusplus)
644  EA_DISABLE_ALL_VC_WARNINGS()
645  #include <cstddef> // Need to trigger the compilation of yvals.h without directly using <yvals.h> because it might not exist.
646  EA_RESTORE_ALL_VC_WARNINGS()
647  #endif
648 
649  #if defined(__cplusplus) && defined(_CPPLIB_VER) /* If using the Dinkumware Standard library... */
650  #define EA_HAVE_DINKUMWARE_CPP_LIBRARY 1
651  #else
652  #define EA_NO_HAVE_DINKUMWARE_CPP_LIBRARY 1
653  #endif
654  #endif
655 
656 
657  // EA_COMPILER_NO_ALIGNED_NEW
658  //
659  //
660  #if !defined(EA_COMPILER_NO_ALIGNED_NEW)
661  #if defined(_HAS_ALIGNED_NEW) && _HAS_ALIGNED_NEW // VS2017 15.5 Preview
662  // supported.
663  #elif defined(EA_COMPILER_CPP17_ENABLED)
664  // supported.
665  #else
666  #define EA_COMPILER_NO_ALIGNED_NEW 1
667  #endif
668  #endif
669 
670  // EA_COMPILER_NO_NEW_THROW_SPEC / EA_THROW_SPEC_NEW / EA_THROW_SPEC_DELETE
671  //
672  // If defined then the compiler's version of operator new is not decorated
673  // with a throw specification. This is useful for us to know because we
674  // often want to write our own overloaded operator new implementations.
675  // We need such operator new overrides to be declared identically to the
676  // way the compiler is defining operator new itself.
677  //
678  // Example usage:
679  // void* operator new(std::size_t) EA_THROW_SPEC_NEW(std::bad_alloc);
680  // void* operator new[](std::size_t) EA_THROW_SPEC_NEW(std::bad_alloc);
681  // void* operator new(std::size_t, const std::nothrow_t&) EA_THROW_SPEC_NEW_NONE();
682  // void* operator new[](std::size_t, const std::nothrow_t&) EA_THROW_SPEC_NEW_NONE();
683  // void operator delete(void*) EA_THROW_SPEC_DELETE_NONE();
684  // void operator delete[](void*) EA_THROW_SPEC_DELETE_NONE();
685  // void operator delete(void*, const std::nothrow_t&) EA_THROW_SPEC_DELETE_NONE();
686  // void operator delete[](void*, const std::nothrow_t&) EA_THROW_SPEC_DELETE_NONE();
687  //
688  #if defined(EA_HAVE_DINKUMWARE_CPP_LIBRARY)
689  #if defined(_MSC_VER) && (_MSC_VER >= 1912) // VS2017 15.3+
690  #define EA_THROW_SPEC_NEW(x) noexcept(false)
691  #define EA_THROW_SPEC_NEW_NONE() noexcept
692  #define EA_THROW_SPEC_DELETE_NONE() noexcept
693 
694  #elif defined(_MSC_VER) && (_MSC_VER >= 1910) // VS2017+
695  #define EA_THROW_SPEC_NEW(x) throw(x)
696  #define EA_THROW_SPEC_NEW_NONE() throw()
697  #define EA_THROW_SPEC_DELETE_NONE() throw()
698 
699  #else
700  #if defined(EA_PLATFORM_SONY)
701  #define EA_THROW_SPEC_NEW(X) _THROWS(X)
702  #elif defined(_MSC_VER)
703  // Disabled warning "nonstandard extension used: 'throw (...)'" as this warning is a W4 warning which is usually off by default
704  // and doesn't convey any important information but will still complain when building with /Wall (which most teams do)
705  #define EA_THROW_SPEC_NEW(X) __pragma(warning(push)) __pragma(warning(disable: 4987)) _THROWS(X) __pragma(warning(pop))
706  #else
707  #define EA_THROW_SPEC_NEW(X) _THROW1(X)
708  #endif
709  #define EA_THROW_SPEC_NEW_NONE() _THROW0()
710  #define EA_THROW_SPEC_DELETE_NONE() _THROW0()
711 
712  #endif
713  #elif defined(EA_COMPILER_NO_EXCEPTIONS) && !defined(EA_COMPILER_RVCT) && !defined(EA_PLATFORM_LINUX) && !defined(EA_PLATFORM_APPLE) && !defined(CS_UNDEFINED_STRING)
714  #define EA_COMPILER_NO_NEW_THROW_SPEC 1
715 
716  #define EA_THROW_SPEC_NEW(x)
717  #define EA_THROW_SPEC_NEW_NONE()
718  #define EA_THROW_SPEC_DELETE_NONE()
719  #else
720  #define EA_THROW_SPEC_NEW(x) throw(x)
721  #define EA_THROW_SPEC_NEW_NONE() throw()
722  #define EA_THROW_SPEC_DELETE_NONE() throw()
723  #endif
724 
725 
726  // EA_COMPILER_NO_STANDARD_CPP_LIBRARY
727  //
728  // If defined, then the compiler doesn't provide a Standard C++ library.
729  //
730  #if defined(EA_PLATFORM_ANDROID)
731  // Disabled because EA's eaconfig/android_config/android_sdk packages currently
732  // don't support linking STL libraries. Perhaps we can figure out what linker arguments
733  // are needed for an app so we can manually specify them and then re-enable this code.
734  //#include <android/api-level.h>
735  //
736  //#if (__ANDROID_API__ < 9) // Earlier versions of Android provide no std C++ STL implementation.
737  #define EA_COMPILER_NO_STANDARD_CPP_LIBRARY 1
738  //#endif
739  #endif
740 
741 
742  // EA_COMPILER_NO_STATIC_VARIABLE_INIT
743  //
744  // If defined, it means that global or static C++ variables will be
745  // constructed. Not all compiler/platorm combinations support this.
746  // User code that needs to be portable must avoid having C++ variables
747  // that construct before main.
748  //
749  //#if defined(EA_PLATFORM_MOBILE)
750  // #define EA_COMPILER_NO_STATIC_VARIABLE_INIT 1
751  //#endif
752 
753 
754  // EA_COMPILER_NO_STATIC_FUNCTION_INIT
755  //
756  // If defined, it means that functions marked as startup functions
757  // (e.g. __attribute__((constructor)) in GCC) are supported. It may
758  // be that some compiler/platform combinations don't support this.
759  //
760  //#if defined(XXX) // So far, all compiler/platforms we use support this.
761  // #define EA_COMPILER_NO_STATIC_VARIABLE_INIT 1
762  //#endif
763 
764  // EA_COMPILER_NO_VARIADIC_MACROS
765  //
766  // If defined, the compiler doesn't support C99/C++11 variadic macros.
767  // With a variadic macro, you can do this:
768  // #define MY_PRINTF(format, ...) printf(format, __VA_ARGS__)
769  //
770  #if !defined(EA_COMPILER_NO_VARIADIC_MACROS)
771  #if defined(_MSC_VER) && (_MSC_VER < 1500) // If earlier than VS2008..
772  #define EA_COMPILER_NO_VARIADIC_MACROS 1
773  #elif defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__)) < 401 // If earlier than GCC 4.1..
774  #define EA_COMPILER_NO_VARIADIC_MACROS 1
775  #elif defined(EA_COMPILER_EDG) // Includes other compilers
776  // variadic macros are supported
777  #endif
778  #endif
779 
780 
781  // EA_COMPILER_NO_RVALUE_REFERENCES
782  //
783  // If defined, the compiler doesn't fully support C++11 rvalue reference semantics.
784  // This applies to the compiler only and not the Standard Library in use with the compiler,
785  // which is required by the Standard to have some support itself.
786  //
787  #if !defined(EA_COMPILER_NO_RVALUE_REFERENCES)
788  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (_MSC_VER >= 1600) // VS2010+
789  // supported.
790  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 403) // EDG 4.3+.
791  // supported. Earlier EDG supported a subset of rvalue references. Implicit move constructors and assignment operators aren't supported until EDG 4.5.
792  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && EA_COMPILER_HAS_FEATURE(cxx_rvalue_references)
793  // supported.
794  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4005) // GCC 4.5+
795  // supported.
796  #else
797  #define EA_COMPILER_NO_RVALUE_REFERENCES 1
798  #endif
799  #endif
800 
801 
802  // EA_COMPILER_NO_EXTERN_TEMPLATE
803  //
804  // If defined, the compiler doesn't support C++11 extern template.
805  // With extern templates, you can do this:
806  // extern template void DoSomething(KnownType u);
807  //
808  #if !defined(EA_COMPILER_NO_EXTERN_TEMPLATE)
809  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (_MSC_VER >= 1700) // VS2012+...
810  // Extern template is supported.
811  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 401) // EDG 4.1+.
812  // supported.
813  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && defined(__apple_build_version__) && (EA_COMPILER_VERSION >= 401)
814  // Extern template is supported.
815  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && !defined(__apple_build_version__) // Clang other than Apple's Clang
816  // Extern template is supported.
817  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4006) // GCC 4.6+
818  // Extern template is supported.
819  #else
820  #define EA_COMPILER_NO_EXTERN_TEMPLATE 1
821  #endif
822  #endif
823 
824 
825  // EA_COMPILER_NO_RANGE_BASED_FOR_LOOP
826  //
827  // If defined, the compiler doesn't support C++11 range-based for loops.
828  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
829  // You must #include <iterator> for range-based for loops to work.
830  // Example usage:
831  // #include <iterator>
832  // #include <vector>
833  // std::vector<float> floatVector;
834  // for(float& f : floatVector)
835  // f += 1.0;
836  //
837  #if !defined(EA_COMPILER_NO_RANGE_BASED_FOR_LOOP)
838  #if defined(EA_COMPILER_CPP11_ENABLED) && (defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1700)) // VS2012+...
839  // supported.
840  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 405) // EDG 4.5+.
841  // supported.
842  #elif defined(EA_COMPILER_CPP11_ENABLED) && (defined(__clang__) && (EA_COMPILER_VERSION >= 300)) // Clang 3.x+
843  // supported.
844  #elif defined(EA_COMPILER_CPP11_ENABLED) && (defined(__GNUC__) && (EA_COMPILER_VERSION >= 4006)) // GCC 4.6+
845  // supported.
846  #else
847  #define EA_COMPILER_NO_RANGE_BASED_FOR_LOOP 1
848  #endif
849  #endif
850 
851 
852  // EA_COMPILER_NO_CONSTEXPR
853  //
854  // Refers to C++11 = constexpr (const expression) declarations.
855  //
856  #if !defined(EA_COMPILER_NO_CONSTEXPR)
857  #if defined(EA_COMPILER_CPP11_ENABLED) && (defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1900)) // VS2015+... Not present in VC++ up to and including VS2013.
858  // supported.
859  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 406) // EDG 4.6+.
860  // supported.
861  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && EA_COMPILER_HAS_FEATURE(cxx_constexpr)
862  // supported.
863  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4006) // GCC 4.6+
864  // supported.
865  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1900) // VS 2015+
866  // supported.
867  #else
868  #define EA_COMPILER_NO_CONSTEXPR 1
869  #endif
870  #endif
871 
872 
873  // EA_COMPILER_NO_CONSTEXPR_IF
874  //
875  // Refers to C++17 = constexpr if(const expression) conditionals.
876  //
877  #if !defined(EA_COMPILER_NO_CONSTEXPR_IF)
878  #if defined(EA_COMPILER_CPP17_ENABLED) && (defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1911)) // VS2017 15.3+
879  // supported.
880  #elif defined(EA_COMPILER_CPP17_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 309) // Clang 3.9+
881  // supported.
882  #elif defined(EA_COMPILER_CPP17_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 7000) // GCC 7+
883  // supported.
884  #else
885  #define EA_COMPILER_NO_CONSTEXPR_IF 1
886  #endif
887  #endif
888 
889 
890  // EA_COMPILER_NO_OVERRIDE
891  //
892  // Refers to the C++11 override specifier.
893  //
894  #ifndef EA_COMPILER_NO_OVERRIDE
895  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION > 1600) // VC++ > VS2010, even without C++11 support. VS2010 does support override, however will generate warnings due to the keyword being 'non-standard'
896  // supported.
897  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+
898  // supported.
899  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4007) // GCC 4.7+
900  // supported.
901  #else
902  #define EA_COMPILER_NO_OVERRIDE 1
903  #endif
904  #endif
905 
906 
907  // EA_COMPILER_NO_INHERITANCE_FINAL
908  //
909  // Refers to the C++11 final specifier.
910  //
911  #ifndef EA_COMPILER_NO_INHERITANCE_FINAL
912  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1500) // VS2008+, even without C++11 support.
913  // supported, though you need to use EA_INHERITANCE_FINAL for it to work with VS versions prior to 2012.
914  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+
915  // supported
916  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4007) // GCC 4.7+
917  // supported
918  #else
919  #define EA_COMPILER_NO_INHERITANCE_FINAL 1
920  #endif
921  #endif
922 
923 
924  // EA_COMPILER_NO_AUTO
925  //
926  // Refers to C++11 auto.
927  //
928  #if !defined(EA_COMPILER_NO_AUTO)
929  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1600) // VS2010+
930  // supported.
931  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 401) // EDG 4.1+.
932  // supported with the exception of the usage of braced initializer lists as of EDG 4.3.
933  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
934  // supported.
935  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
936  // supported.
937  #else
938  #define EA_COMPILER_NO_AUTO 1
939  #endif
940  #endif
941 
942 
943  // EA_COMPILER_NO_NULLPTR
944  //
945  // Refers to C++11 nullptr (which is a built in type). std::nullptr_t is defined in C++11 <cstddef>.
946  // Note that <EABase/nullptr.h> implements a portable nullptr implementation.
947  //
948  #if !defined(EA_COMPILER_NO_NULLPTR)
949  #if (defined(_MSC_VER) && (_MSC_VER >= 1600)) && defined(EA_COMPILER_CPP11_ENABLED)
950  // supported
951  #elif defined(EA_COMPILER_GNUC) && (EA_COMPILER_VERSION >= 4006) && defined(EA_COMPILER_CPP11_ENABLED)
952  // supported
953  #elif defined(__clang__) && defined(EA_COMPILER_CPP11_ENABLED)
954  // supported
955  #elif defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 403) && defined(EA_COMPILER_CPP11_ENABLED)
956  // supported
957  #else
958  #define EA_COMPILER_NO_NULLPTR 1
959  #endif
960  #endif
961 
962 
963  // EA_COMPILER_NO_DECLTYPE
964  //
965  // Refers to C++11 decltype.
966  //
967  #if !defined(EA_COMPILER_NO_DECLTYPE)
968  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1600) // VS2010+
969  // supported, though VS2010 doesn't support the spec completely as specified in the final standard.
970  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 401) // EDG 4.1+.
971  // supported.
972  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
973  // supported.
974  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4003) // GCC 4.3+
975  // supported.
976  #else
977  #define EA_COMPILER_NO_DECLTYPE 1
978  #endif
979  #endif
980 
981 
982 
983  // EA_COMPILER_NO_DEFAULTED_FUNCTIONS
984  // EA_COMPILER_NO_DELETED_FUNCTIONS
985  //
986  // Refers to C++11 = default and = delete function declarations.
987  //
988  #if !defined(EA_COMPILER_NO_DEFAULTED_FUNCTIONS)
989  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+
990  // supported, but as of VS2013 it isn't supported for defaulted move constructors and move assignment operators.
991  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 401) // EDG 4.1+.
992  // supported, but as of EDG 4.3 it isn't supported for defaulted move constructors and move assignment operators until EDG 4.5.
993  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) // Clang 3.0+, including Apple's Clang
994  // supported.
995  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
996  // supported.
997  #else
998  // VC++ doesn't support it as of VS2012.
999  #define EA_COMPILER_NO_DEFAULTED_FUNCTIONS 1
1000  #endif
1001  #endif
1002 
1003  #if !defined(EA_COMPILER_NO_DELETED_FUNCTIONS)
1004  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+
1005  // supported, but as of VS2013 it isn't supported for defaulted move constructors and move assignment operators.
1006  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 401) // EDG 4.1+.
1007  // supported.
1008  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+
1009  // supported.
1010  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1011  // supported.
1012  #else
1013  // VC++ doesn't support it as of VS2012.
1014  #define EA_COMPILER_NO_DELETED_FUNCTIONS 1
1015  #endif
1016  #endif
1017 
1018 
1019  // EA_COMPILER_NO_LAMBDA_EXPRESSIONS
1020  //
1021  // Refers to C++11 lambda expressions.
1022  //
1023  #if !defined(EA_COMPILER_NO_LAMBDA_EXPRESSIONS)
1024  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1600) // VS2010+
1025  // supported, though VS2010 doesn't support the spec completely as specified in the final standard.
1026  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 401) // EDG 4.1+.
1027  // supported. However, converting lambdas to function pointers is not supported until EDG 4.5.
1028  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__)
1029  // supported.
1030  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1031  // supported.
1032  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1033  // supported.
1034  #else
1035  #define EA_COMPILER_NO_LAMBDA_EXPRESSIONS 1
1036  #endif
1037  #endif
1038 
1039 
1040  // EA_COMPILER_NO_TRAILING_RETURN_TYPES
1041  //
1042  // Refers to C++11 trailing-return-type. Also sometimes referred to as "incomplete return type".
1043  //
1044  #if !defined(EA_COMPILER_NO_TRAILING_RETURN_TYPES)
1045  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1600) // VS2010+
1046  // supported, though VS2010 doesn't support the spec completely as specified in the final standard.
1047  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 402) // EDG 4.2+.
1048  // supported. However, use of "this" in trailing return types is not supported untiil EDG 4.4
1049  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__)
1050  // supported.
1051  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1052  // supported.
1053  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1054  // supported.
1055  #else
1056  #define EA_COMPILER_NO_TRAILING_RETURN_TYPES 1
1057  #endif
1058  #endif
1059 
1060 
1061  // EA_COMPILER_NO_STRONGLY_TYPED_ENUMS
1062  //
1063  // Refers to C++11 strongly typed enums, which includes enum classes and sized enums. Doesn't include forward-declared enums.
1064  //
1065  #if !defined(EA_COMPILER_NO_STRONGLY_TYPED_ENUMS)
1066  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1700) // VS2012+
1067  // supported. A subset of this is actually supported by VS2010.
1068  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 400) // EDG 4.0+.
1069  // supported.
1070  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
1071  // supported.
1072  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1073  // supported.
1074  #else
1075  #define EA_COMPILER_NO_STRONGLY_TYPED_ENUMS 1
1076  #endif
1077  #endif
1078 
1079 
1080  // EA_COMPILER_NO_FORWARD_DECLARED_ENUMS
1081  //
1082  // Refers to C++11 forward declared enums.
1083  //
1084  #if !defined(EA_COMPILER_NO_FORWARD_DECLARED_ENUMS)
1085  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1700) // VS2012+
1086  // supported.
1087  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 405) // EDG 4.5+.
1088  // supported. EDG 4.3 supports basic forward-declared enums, but not forward-declared strongly typed enums.
1089  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__)
1090  // supported.
1091  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1092  // supported.
1093  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4006) // GCC 4.6+
1094  // supported.
1095  #else
1096  #define EA_COMPILER_NO_FORWARD_DECLARED_ENUMS 1
1097  #endif
1098  #endif
1099 
1100 
1101  // EA_COMPILER_NO_VARIADIC_TEMPLATES
1102  //
1103  // Refers to C++11 variadic templates.
1104  //
1105  #if !defined(EA_COMPILER_NO_VARIADIC_TEMPLATES)
1106  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1107  // supported.
1108  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (_MSC_FULL_VER == 170051025) // VS2012 November Preview for Windows only.
1109  // supported.
1110  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 403) // EDG 4.3+.
1111  // supported, though 4.1 has partial support for variadic templates.
1112  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
1113  // supported.
1114  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1115  // supported, though GCC 4.3 has partial support for variadic templates.
1116  #else
1117  #define EA_COMPILER_NO_VARIADIC_TEMPLATES 1
1118  #endif
1119  #endif
1120 
1121 
1122  // EA_COMPILER_NO_TEMPLATE_ALIASES
1123  //
1124  // Refers to C++11 alias templates.
1125  // Example alias template usage:
1126  // template <typename T>
1127  // using Dictionary = eastl::map<eastl::string, T>;
1128  //
1129  // Dictionary<int> StringIntDictionary;
1130  //
1131  #if !defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
1132  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1133  // supported.
1134  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__)
1135  // supported.
1136  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 402) // EDG 4.2+.
1137  // supported, though 4.1 has partial support for variadic templates.
1138  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1139  // supported.
1140  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4007) // GCC 4.7+
1141  // supported, though GCC 4.3 has partial support for variadic templates.
1142  #else
1143  #define EA_COMPILER_NO_TEMPLATE_ALIASES 1
1144  #endif
1145  #endif
1146 
1147 
1148  // EA_COMPILER_NO_VARIABLE_TEMPLATES
1149  //
1150  // Refers to C++14 variable templates.
1151  // Example variable template usage:
1152  // template<class T>
1153  // constexpr T pi = T(3.1415926535897932385);
1154  //
1155  #if !defined(EA_COMPILER_NO_VARIABLE_TEMPLATES)
1156  #if defined(_MSC_VER) && (_MSC_FULL_VER >= 190023918) // VS2015 Update 2 and above.
1157  // supported.
1158  #elif defined(EA_COMPILER_CPP14_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 304) && !defined(__apple_build_version__) // Clang 3.4+, not including Apple's Clang.
1159  // supported.
1160  #elif defined(EA_COMPILER_CPP14_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 5000) // GCC 5+
1161  // supported.
1162  #elif !defined(EA_COMPILER_CPP14_ENABLED)
1163  #define EA_COMPILER_NO_VARIABLE_TEMPLATES 1
1164  #endif
1165  #endif
1166 
1167 
1168  // EA_COMPILER_NO_INLINE_VARIABLES
1169  //
1170  // Refers to C++17 inline variables that allows the definition of variables in header files
1171  //
1172  // Example usage:
1173  // struct Foo
1174  // {
1175  // static inline constexpr int kConstant = 42; // no out of class definition
1176  // };
1177  //
1178  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4424.pdf
1179  // http://en.cppreference.com/w/cpp/language/inline
1180  //
1181  #if !defined(EA_COMPILER_NO_INLINE_VARIABLES)
1182  #define EA_COMPILER_NO_INLINE_VARIABLES 1
1183  #endif
1184 
1185 
1186  // EA_COMPILER_NO_INITIALIZER_LISTS
1187  //
1188  // Refers to C++11 initializer lists.
1189  // This refers to the compiler support for this and not the Standard Library support (std::initializer_list).
1190  //
1191  #if !defined(EA_COMPILER_NO_INITIALIZER_LISTS)
1192  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1193  // supported.
1194  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (_MSC_FULL_VER == 170051025) // VS2012 November Preview for Windows only.
1195  // supported.
1196  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 405) // EDG 4.5+.
1197  // supported.
1198  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__)
1199  // supported.
1200  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1201  // supported.
1202  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1203  // supported, though GCC 4.3 has partial support for it.
1204  #else
1205  #define EA_COMPILER_NO_INITIALIZER_LISTS 1
1206  #endif
1207  #endif
1208 
1209 
1210  // EA_COMPILER_NO_NORETURN
1211  //
1212  // Refers to C++11 declaration attribute: noreturn.
1213  // http://en.cppreference.com/w/cpp/language/attributes
1214  // http://blog.aaronballman.com/2011/09/understanding-attributes/
1215  //
1216  #if !defined(EA_COMPILER_NO_NORETURN)
1217  #if defined(EA_COMPILER_MSVC) && (EA_COMPILER_VERSION >= 1300) // VS2003+
1218  // supported via __declspec(noreturn). You need to use that or EA_NORETURN. VC++ up to VS2013 doesn't support any C++11 attribute types.
1219  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 402) // EDG 4.2+.
1220  // supported.
1221  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__)
1222  // supported.
1223  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1224  // supported.
1225  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4008) // GCC 4.8+
1226  // supported.
1227  #else
1228  #define EA_COMPILER_NO_NORETURN 1
1229  #endif
1230  #endif
1231 
1232 
1233  // EA_COMPILER_NO_CARRIES_DEPENDENCY
1234  //
1235  // Refers to C++11 declaration attribute: carries_dependency.
1236  // http://en.cppreference.com/w/cpp/language/attributes
1237  // http://blog.aaronballman.com/2011/09/understanding-attributes/
1238  //
1239  #if !defined(EA_COMPILER_NO_CARRIES_DEPENDENCY)
1240  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1241  // supported.
1242  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 402) // EDG 4.2+.
1243  // supported; stricter than other compilers in its usage.
1244  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1245  // supported.
1246  // Currently GNUC doesn't appear to support this attribute.
1247  //#elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4008) // GCC 4.8+
1248  // // supported.
1249  #else
1250  #define EA_COMPILER_NO_CARRIES_DEPENDENCY 1
1251  #endif
1252  #endif
1253 
1254 
1255  // EA_COMPILER_NO_FALLTHROUGH
1256  //
1257  // Refers to C++17 declaration attribute: fallthrough.
1258  // http://en.cppreference.com/w/cpp/language/attributes
1259  //
1260  #if !defined(EA_COMPILER_NO_FALLTHROUGH)
1261  #if defined(EA_COMPILER_CPP17_ENABLED)
1262  // supported.
1263  #else
1264  #define EA_COMPILER_NO_FALLTHROUGH 1
1265  #endif
1266  #endif
1267 
1268 
1269  // EA_COMPILER_NO_NODISCARD
1270  //
1271  // Refers to C++17 declaration attribute: nodiscard.
1272  // http://en.cppreference.com/w/cpp/language/attributes
1273  //
1274  #if !defined(EA_COMPILER_NO_NODISCARD)
1275  #if defined(EA_COMPILER_CPP17_ENABLED)
1276  // supported.
1277  #else
1278  #define EA_COMPILER_NO_NODISCARD 1
1279  #endif
1280  #endif
1281 
1282 
1283  // EA_COMPILER_NO_MAYBE_UNUSED
1284  //
1285  // Refers to C++17 declaration attribute: maybe_unused.
1286  // http://en.cppreference.com/w/cpp/language/attributes
1287  //
1288  #if !defined(EA_COMPILER_NO_MAYBE_UNUSED)
1289  #if defined(EA_COMPILER_CPP17_ENABLED)
1290  // supported.
1291  #elif defined(EA_COMPILER_MSVC) && (EA_COMPILER_VERSION >= 1912) // VS2017 15.3+
1292  // supported.
1293  #else
1294  #define EA_COMPILER_NO_MAYBE_UNUSED 1
1295  #endif
1296  #endif
1297 
1298 
1299  // EA_COMPILER_NO_STRUCTURED_BINDING
1300  //
1301  // Indicates if target compiler supports the C++17 "structured binding" language feature.
1302  // https://en.cppreference.com/w/cpp/language/structured_binding
1303  //
1304  //
1305  #if !defined(EA_COMPILER_NO_STRUCTURED_BINDING)
1306  #if defined(EA_COMPILER_CPP17_ENABLED)
1307  // supported.
1308  #elif defined(EA_COMPILER_MSVC) && (EA_COMPILER_VERSION >= 1912) // VS2017 15.3+
1309  // supported.
1310  #else
1311  #define EA_COMPILER_NO_STRUCTURED_BINDING 1
1312  #endif
1313  #endif
1314 
1315  #define EA_COMPILER_NO_STRUCTURED_BINDING
1316 
1317 
1318  // EA_COMPILER_NO_DESIGNATED_INITIALIZERS
1319  //
1320  // Indicates the target compiler supports the C++20 "designated initializer" language feature.
1321  // https://en.cppreference.com/w/cpp/language/aggregate_initialization
1322  //
1323  // Example:
1324  // struct A { int x; int y; };
1325  // A a = { .y = 42, .x = 1 };
1326  //
1327  #if !defined(EA_COMPILER_NO_DESIGNATED_INITIALIZERS)
1328  #if defined(EA_COMPILER_CPP20_ENABLED)
1329  // supported.
1330  #else
1331  #define EA_COMPILER_NO_DESIGNATED_INITIALIZERS 1
1332  #endif
1333  #endif
1334 
1335 
1336  // EA_COMPILER_NO_NONSTATIC_MEMBER_INITIALIZERS
1337  //
1338  // Refers to C++11 declaration attribute: carries_dependency.
1339  // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm
1340  //
1341  #if !defined(EA_COMPILER_NO_NONSTATIC_MEMBER_INITIALIZERS)
1342  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1343  // supported.
1344  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1345  // supported.
1346  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1347  // supported.
1348  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4007) // GCC 4.7+
1349  // supported.
1350  #else
1351  #define EA_COMPILER_NO_NONSTATIC_MEMBER_INITIALIZERS 1
1352  #endif
1353  #endif
1354 
1355 
1356  // EA_COMPILER_NO_RIGHT_ANGLE_BRACKETS
1357  //
1358  // Defines if the compiler supports >> (as opposed to > >) in template
1359  // declarations such as typedef eastl::list<eastl::list<int>> ListList;
1360  //
1361  #if !defined(EA_COMPILER_NO_RIGHT_ANGLE_BRACKETS)
1362  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1600) // VS2010+
1363  // supported.
1364  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 401) // EDG 4.1+.
1365  // supported.
1366  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
1367  // supported.
1368  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4003) // GCC 4.3+
1369  // supported.
1370  #else
1371  #define EA_COMPILER_NO_RIGHT_ANGLE_BRACKETS 1
1372  #endif
1373  #endif
1374 
1375 
1376  // EA_COMPILER_NO_ALIGNOF
1377  //
1378  // Refers specifically to C++11 alignof and not old compiler extensions such as __alignof__().
1379  // However, EABase provides a portable EA_ALIGN_OF which works for all compilers.
1380  //
1381  #if !defined(EA_COMPILER_NO_ALIGNOF)
1382  // Not supported by VC++ as of VS2013, though EA_ALIGN_OF is supported on all coompilers as an alternative.
1383  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
1384  // supported.
1385  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4005) // GCC 4.5+
1386  // supported.
1387  #else
1388  #define EA_COMPILER_NO_ALIGNOF 1
1389  #endif
1390  #endif
1391 
1392 
1393  // EA_COMPILER_NO_ALIGNAS
1394  //
1395  // Refers to C++11 alignas.
1396  //
1397  #if !defined(EA_COMPILER_NO_ALIGNAS)
1398  // Not supported by VC++ as of VS2013.
1399  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1400  // supported.
1401  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1402  // supported.
1403  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4008) // GCC 4.8+
1404  // supported.
1405  #else
1406  #define EA_COMPILER_NO_ALIGNAS 1
1407  #endif
1408  #endif
1409 
1410 
1411  // EA_COMPILER_NO_DELEGATING_CONSTRUCTORS
1412  //
1413  // Refers to C++11 constructor delegation.
1414  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
1415  // https://www.ibm.com/developerworks/mydeveloperworks/blogs/5894415f-be62-4bc0-81c5-3956e82276f3/entry/c_0x_delegating_constructors
1416  //
1417  #if !defined(EA_COMPILER_NO_DELEGATING_CONSTRUCTORS)
1418  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1419  // supported.
1420  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 407) // EDG 4.7+.
1421  // supported.
1422  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1423  // supported.
1424  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1425  // supported.
1426  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4007) // GCC 4.7+
1427  // supported.
1428  #else
1429  #define EA_COMPILER_NO_DELEGATING_CONSTRUCTORS 1
1430  #endif
1431  #endif
1432 
1433 
1434  // EA_COMPILER_NO_INHERITING_CONSTRUCTORS
1435  //
1436  // Refers to C++11 constructor inheritance via 'using'.
1437  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
1438  //
1439  #if !defined(EA_COMPILER_NO_INHERITING_CONSTRUCTORS)
1440  // Not supported by VC++ as of VS2013.
1441  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && EA_COMPILER_HAS_FEATURE(cxx_inheriting_constructors) // Clang
1442  // supported.
1443  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4008) // GCC 4.8+
1444  // supported.
1445  #else
1446  #define EA_COMPILER_NO_INHERITING_CONSTRUCTORS 1
1447  #endif
1448  #endif
1449 
1450 
1451  // EA_COMPILER_NO_USER_DEFINED_LITERALS
1452  //
1453  // http://en.cppreference.com/w/cpp/language/user_literal
1454  // http://stackoverflow.com/questions/237804/what-new-capabilities-do-user-defined-literals-add-to-c
1455  //
1456  #if !defined(EA_COMPILER_NO_USER_DEFINED_LITERALS)
1457  // Not supported by VC++ as of VS2013.
1458  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1459  // supported.
1460  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1461  // supported.
1462  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4007) // GCC 4.7+
1463  // supported.
1464  #else
1465  #define EA_COMPILER_NO_USER_DEFINED_LITERALS 1
1466  #endif
1467  #endif
1468 
1469 
1470  // EA_COMPILER_NO_STANDARD_LAYOUT_TYPES
1471  // a.k.a. POD relaxation
1472  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm
1473  //
1474  #if !defined(EA_COMPILER_NO_STANDARD_LAYOUT_TYPES)
1475  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1700) // VS2012+
1476  // supported.
1477  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1478  // supported.
1479  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1480  // supported.
1481  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4005) // GCC 4.5+
1482  // supported.
1483  #else
1484  #define EA_COMPILER_NO_STANDARD_LAYOUT_TYPES 1
1485  #endif
1486  #endif
1487 
1488 
1489  // EA_COMPILER_NO_EXTENDED_SIZEOF
1490  //
1491  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
1492  // Allows you to do this: sizeof(SomeClass::mSomeMember)
1493  //
1494  #if !defined(EA_COMPILER_NO_EXTENDED_SIZEOF)
1495  // Not supported by VC++ as of VS2013.
1496  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1497  // supported.
1498  // Versions of EDG prior to 4.5 only support extended sizeof in non-member functions. Full support was added in 4.5
1499  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 405) // EDG 4.5+.
1500  // supported.
1501  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1502  // supported.
1503  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4005) // GCC 4.5+
1504  // supported.
1505  #else
1506  #define EA_COMPILER_NO_EXTENDED_SIZEOF 1
1507  #endif
1508  #endif
1509 
1510 
1511  // EA_COMPILER_NO_INLINE_NAMESPACES
1512  //
1513  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
1514  // http://blog.aaronballman.com/2011/07/inline-namespaces/
1515  //
1516  #if !defined(EA_COMPILER_NO_INLINE_NAMESPACES)
1517  // Not supported by VC++ as of VS2013.
1518  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 405) // EDG 4.5+.
1519  // supported.
1520  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
1521  // supported.
1522  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1523  // supported.
1524  #else
1525  #define EA_COMPILER_NO_INLINE_NAMESPACES 1
1526  #endif
1527  #endif
1528 
1529 
1530  // EA_COMPILER_NO_UNRESTRICTED_UNIONS
1531  //
1532  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
1533  //
1534  #if !defined(EA_COMPILER_NO_UNRESTRICTED_UNIONS)
1535  // Not supported by VC++ as of VS2013.
1536  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 406) // EDG 4.6+.
1537  // supported.
1538  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1539  // supported.
1540  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1541  // supported.
1542  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4006) // GCC 4.6+
1543  // supported.
1544  #else
1545  #define EA_COMPILER_NO_UNRESTRICTED_UNIONS 1
1546  #endif
1547  #endif
1548 
1549 
1550  // EA_COMPILER_NO_EXPLICIT_CONVERSION_OPERATORS
1551  //
1552  // http://en.wikipedia.org/wiki/C%2B%2B11#Explicit_conversion_operators
1553  //
1554  #if !defined(EA_COMPILER_NO_EXPLICIT_CONVERSION_OPERATORS)
1555  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1556  // supported.
1557  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (_MSC_FULL_VER == 170051025) // VS2012 November Preview for Windows only.
1558  // supported.
1559  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 404) // EDG 4.4+.
1560  // supported.
1561  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1562  // supported.
1563  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1564  // supported.
1565  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4005) // GCC 4.5+
1566  // supported.
1567  #else
1568  #define EA_COMPILER_NO_EXPLICIT_CONVERSION_OPERATORS 1
1569  #endif
1570  #endif
1571 
1572 
1573  // EA_COMPILER_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
1574  //
1575  // The compiler does not support default template arguments for function templates.
1576  // http://stackoverflow.com/questions/2447458/default-template-arguments-for-function-templates
1577  //
1578  #if !defined(EA_COMPILER_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS)
1579  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1580  // supported.
1581  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 403) // EDG 4.4+.
1582  // supported.
1583  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
1584  // supported.
1585  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4003) // GCC 4.3+
1586  // supported.
1587  #else
1588  #define EA_COMPILER_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS 1
1589  #endif
1590  #endif
1591 
1592 
1593  // EA_COMPILER_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS
1594  //
1595  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
1596  // http://stackoverflow.com/questions/5751977/local-type-as-template-arguments-in-c
1597  //
1598  #if !defined(EA_COMPILER_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS)
1599  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1600) // VS2010+
1600  // supported.
1601  #if (EA_COMPILER_VERSION < 1700) // VS2010 generates a warning, but the C++ language now allows it.
1602  #pragma warning(disable: 4836) // nonstandard extension used: local types or unnamed types cannot be used as template arguments.
1603  #endif
1604  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 402) // EDG 4.2+.
1605  // supported.
1606  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
1607  // supported.
1608  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4005) // GCC 4.5+
1609  // supported.
1610  #else
1611  #define EA_COMPILER_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS 1
1612  #endif
1613  #endif
1614 
1615 
1616  // EA_COMPILER_NO_NOEXCEPT
1617  //
1618  // C++11 noexcept
1619  // http://en.cppreference.com/w/cpp/language/attributes
1620  // http://en.cppreference.com/w/cpp/language/noexcept
1621  //
1622  #if !defined(EA_COMPILER_NO_NOEXCEPT)
1623  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1900) // VS2014+
1624  // supported.
1625  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1626  // supported.
1627  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 405) // EDG 4.5+.
1628  // supported.
1629  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1630  // supported.
1631  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4006) // GCC 4.6+
1632  // supported.
1633  #else
1634  #define EA_COMPILER_NO_NOEXCEPT 1
1635  #endif
1636  #endif
1637 
1638 
1639  // EA_COMPILER_NO_RAW_LITERALS
1640  //
1641  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
1642  // http://en.wikipedia.org/wiki/C%2B%2B11#New_string_literals
1643  //
1644  #if !defined(EA_COMPILER_NO_RAW_LITERALS)
1645  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1646  // supported.
1647  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 407) // EDG 4.7+.
1648  // supported.
1649  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1650  // supported.
1651  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1652  // supported.
1653  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4005) // GCC 4.5+
1654  // supported.
1655  #else
1656  #define EA_COMPILER_NO_RAW_LITERALS 1
1657  #endif
1658  #endif
1659 
1660 
1661  // EA_COMPILER_NO_UNICODE_STRING_LITERALS
1662  //
1663  // http://en.wikipedia.org/wiki/C%2B%2B11#New_string_literals
1664  //
1665  #if !defined(EA_COMPILER_NO_UNICODE_STRING_LITERALS)
1666  // Not supported by VC++ as of VS2013.
1667  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 407) // EDG 4.7+.
1668  // supported. It's not clear if it's v4.4 or v4.7 that adds this support.
1669  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1670  // supported.
1671  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 300) && !defined(__apple_build_version__) // Clang 3.0+, not including Apple's Clang.
1672  // supported.
1673  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1674  // supported.
1675  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 407) // EDG 4.7+.
1676  // supported. It's not clear if it's v4.4 or v4.7 that adds this support.
1677  #else
1678  #define EA_COMPILER_NO_UNICODE_STRING_LITERALS 1
1679  #endif
1680  #endif
1681 
1682 
1683  // EA_COMPILER_NO_NEW_CHARACTER_TYPES
1684  //
1685  // Refers to char16_t and char32_t as true native types (and not something simply typedef'd from uint16_t and uint32_t).
1686  // http://en.cppreference.com/w/cpp/language/types
1687  //
1688  #if !defined(EA_COMPILER_NO_NEW_CHARACTER_TYPES)
1689  #if defined(EA_COMPILER_NO_UNICODE_STRING_LITERALS) // Some compilers have had support for char16_t prior to support for u"", but it's not useful to have the former without the latter.
1690  #define EA_COMPILER_NO_NEW_CHARACTER_TYPES 1
1691  #endif
1692  #endif
1693 
1694 
1695  // EA_COMPILER_NO_UNICODE_CHAR_NAME_LITERALS
1696  //
1697  // C++ 11 relaxed \u\U sequences in strings.
1698  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
1699  //
1700  #if !defined(EA_COMPILER_NO_UNICODE_CHAR_NAME_LITERALS)
1701  // VC++ up till at least VS2013 supports \u and \U but supports them wrong with respect to the C++11 Standard.
1702 
1703  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1704  // supported.
1705  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1706  // supported.
1707  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4005) // GCC 4.5+
1708  // supported.
1709  #else
1710  #define EA_COMPILER_NO_UNICODE_CHAR_NAME_LITERALS 1
1711  #endif
1712  #endif
1713 
1714 
1715  // EA_COMPILER_NO_UNIFIED_INITIALIZATION_SYNTAX
1716  //
1717  // http://en.wikipedia.org/wiki/C%2B%2B11#Uniform_initialization
1718  //
1719  #if !defined(EA_COMPILER_NO_UNIFIED_INITIALIZATION_SYNTAX)
1720  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1800) // VS2013+.
1721  // supported.
1722  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 401) && defined(__apple_build_version__) // Apple clang 4.1+
1723  // supported.
1724  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 301) && !defined(__apple_build_version__) // Clang 3.1+, not including Apple's Clang.
1725  // supported.
1726  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4004) // GCC 4.4+
1727  // supported.
1728  #else
1729  #define EA_COMPILER_NO_UNIFIED_INITIALIZATION_SYNTAX 1
1730  #endif
1731  #endif
1732 
1733 
1734  // EA_COMPILER_NO_EXTENDED_FRIEND_DECLARATIONS
1735  //
1736  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
1737  //
1738  #if !defined(EA_COMPILER_NO_EXTENDED_FRIEND_DECLARATIONS)
1739  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1600) // VS2010+
1740  // supported.
1741  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 401) // EDG 4.1+.
1742  // supported.
1743  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && (EA_COMPILER_VERSION >= 209) // Clang 2.9+, including Apple's Clang.
1744  // supported.
1745  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4007) // GCC 4.7+
1746  // supported.
1747  #else
1748  #define EA_COMPILER_NO_EXTENDED_FRIEND_DECLARATIONS 1
1749  #endif
1750  #endif
1751 
1752 
1753  // EA_COMPILER_NO_THREAD_LOCAL
1754  //
1755  // Refers specifically to C++ thread_local, which is like compiler __thread implementations except
1756  // that it also supports non-trivial classes (e.g. with ctors). EA_COMPILER_NO_THREAD_LOCAL refers
1757  // specifically to full C++11 thread_local support. The EAThread package provides a wrapper for
1758  // __thread via EA_THREAD_LOCAL (which unfortunately sounds like C++ thread_local).
1759  //
1760  // https://en.cppreference.com/w/cpp/keyword/thread_local
1761  //
1762  #if !defined(EA_COMPILER_NO_THREAD_LOCAL)
1763  #if defined(EA_COMPILER_CPP11_ENABLED) && defined(__clang__) && EA_COMPILER_HAS_FEATURE(cxx_thread_local)
1764  // supported.
1765  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(_MSC_VER) && (EA_COMPILER_VERSION >= 1900) // VS2015+
1766  // supported.
1767  #elif defined(EA_COMPILER_CPP11_ENABLED) && defined(__GNUC__) && (EA_COMPILER_VERSION >= 4008) // GCC 4.8+
1768  // supported.
1769  #else
1770  #define EA_COMPILER_NO_THREAD_LOCAL 1
1771  #endif
1772  #endif
1773 
1774 
1775 #endif // INCLUDED_eacompiler_H
1776 
1777 
1778 
1779 
1780