nlib
Config_gcc.h
1 
2 /*--------------------------------------------------------------------------------*
3  Project: CrossRoad
4  Copyright (C)Nintendo All rights reserved.
5 
6  These coded instructions, statements, and computer programs contain proprietary
7  information of Nintendo and/or its licensed developers and are protected by
8  national and international copyright laws. They may not be disclosed to third
9  parties or copied or duplicated in any form, in whole or in part, without the
10  prior written consent of Nintendo.
11 
12  The content herein is highly confidential and should be handled accordingly.
13  *--------------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_CONFIG_GCC_H_
17 #define INCLUDE_NN_NLIB_CONFIG_GCC_H_
18 #ifndef INCLUDE_NN_NLIB_CONFIG_H_
19 # error do not include directly
20 #endif
21 
22 #if defined(__GNUC__)
23 
24 #ifdef __EXCEPTIONS
25 # define NLIB_EXCEPTION_ENABLED
26 #endif
27 
28 #if __GNUC__ > 4
29 # define NLIB_CXX11_RVALUE_REFERENCES
30 # define NLIB_CXX11_STATIC_ASSERTIONS
31 # define NLIB_CXX11_EXTERN_TEMPLATES
32 # define NLIB_CXX11_DEFAULTED_AND_DELETED_FUNCTIONS
33 # define NLIB_CXX11_EXPLICIT_CONVERSION_OPERATORS
34 # define NLIB_CXX11_NULL_POINTER_CONSTANT
35 # define NLIB_CXX11_RANGE_BASED_FOR
36 # define NLIB_CXX11_EXPLICIT_VIRTUAL_OVERRIDES
37 # define NLIB_CXX11_TEMPLATE_ALIAS
38 # define NLIB_CXX11_ALIGNMENT_SUPPORT
39 # define NLIB_CXX11_LAMBDAS
40 # define NLIB_CXX11_CONSTEXPR
41 # define NLIB_CXX11_DEFAULT_TEMPLATE_ARGUMENT_FOR_FUNCTION_TEMPLATES
42 #elif __GNUC__ == 4
43 # if __GNUC_MINOR__ <= 6 || __cplusplus > 199711L
44 
45 # if __GNUC_MINOR__ >= 3
46 # define NLIB_CXX11_RVALUE_REFERENCES
47 # define NLIB_CXX11_STATIC_ASSERTIONS
48 # define NLIB_CXX11_EXTERN_TEMPLATES
49 # define NLIB_CXX11_SWAPHEADER
50 # define NLIB_CXX11_DEFAULT_TEMPLATE_ARGUMENT_FOR_FUNCTION_TEMPLATES
51 # endif
52 
53 # if __GNUC_MINOR__ >= 4
54 # define NLIB_CXX11_DEFAULTED_AND_DELETED_FUNCTIONS
55 # endif
56 
57 # if __GNUC_MINOR__ >= 5
58 # endif
59 
60 # if __GNUC_MINOR__ >= 6
61 # define NLIB_CXX11_EXPLICIT_CONVERSION_OPERATORS
62 # define NLIB_CXX11_NULL_POINTER_CONSTANT
63 # define NLIB_CXX11_RANGE_BASED_FOR
64 # endif
65 
66 # if __GNUC_MINOR__ >= 7
67 # define NLIB_CXX11_VARIADIC_TEMPLATES // gcc4.6 cannot expand 'typedef Types<TAIL...> Tail;'
68 # define NLIB_CXX11_CONSTEXPR
69 # define NLIB_CXX11_EXPLICIT_VIRTUAL_OVERRIDES
70 # define NLIB_CXX11_TEMPLATE_ALIAS
71 # define NLIB_CXX11_LAMBDAS
72 # define NLIB_CXX11_DELEGATING_CONSTRUCTORS
73 # endif
74 
75 # if __GNUC_MINOR__ >= 8
76 # define NLIB_CXX11_ALIGNMENT_SUPPORT
77 # endif
78 # endif
79 #else
80 # error
81 #endif
82 
83 #include <bits/c++config.h>
84 #ifndef __GLIBCXX__
85 # error c++config.h should define __GLIBCXX__ ...
86 #endif
87 
88 #if __GLIBCXX__ >= 20100414
89 # define NLIB_CXX11_UNIQUEPTR
90 # define NLIB_CXX11_STDLIB_ARRAY
91 # define NLIB_CXX11_STDLIB_UNORDERED
92 # define NLIB_CXX11_STDLIB_TUPLE
93 #endif
94 #if __GLIBCXX__ >= 20120322
95 // https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
96 # define NLIB_HAS_NATIVE_TYPETRAITS
97 # define NLIB_CXX11_STDLIB_RANDOM
98 # define NLIB_CXX11_STDLIB_CHRONO
99 # define NLIB_CXX11_STDLIB_ATOMIC
100 #endif
101 
102 #include <cassert> // NOLINT
103 #define NLIB_ASSERT assert
104 
105 #define NLIB_ALIGNAS(x) __attribute__((aligned(x)))
106 #define NLIB_ALIGNOF(tp) __alignof__(tp)
107 
108 #endif
109 #endif // INCLUDE_NN_NLIB_CONFIG_GCC_H_