2 // This configuration file is designed to be included by another,
3 // specific configuration file. It provides config information common
4 // to all g++ platforms, including egcs.
6 #ifndef ACE_GNUG_COMMON_H
7 #define ACE_GNUG_COMMON_H
8 #include /**/ "ace/pre.h"
10 #if !defined (ACE_CC_NAME)
11 # define ACE_CC_NAME ACE_TEXT ("g++")
13 #define ACE_CC_MAJOR_VERSION __GNUC__
14 #define ACE_CC_MINOR_VERSION __GNUC_MINOR__
15 #define ACE_CC_BETA_VERSION (0)
17 #if __cplusplus >= 202002L
18 # define ACE_HAS_CPP20
20 #if __cplusplus >= 201703L
21 # define ACE_HAS_CPP17
22 # define ACE_FALLTHROUGH [[fallthrough]]
24 #if __cplusplus >= 201402L
25 # define ACE_HAS_CPP14
27 #if __cplusplus >= 201103L
28 # define ACE_HAS_CPP11
29 # if !defined (ACE_FALLTHROUGH)
31 # define ACE_FALLTHROUGH [[gnu::fallthrough]]
33 # define ACE_FALLTHROUGH
38 #if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE)
39 # define ACE_SIZEOF_LONG_DOUBLE 12
42 #if !defined (__MINGW32__) && (defined (i386) || defined (__i386__))
43 // If running an Intel, assume that it's a Pentium so that
44 // ACE_OS::gethrtime () can use the RDTSC instruction. If running a
45 // 486 or lower, be sure to comment this out. (If not running an
46 // Intel CPU, this #define will not be seen because of the i386
47 // protection, so it can be ignored.)
48 # define ACE_HAS_PENTIUM
51 #if (defined (ACE_HAS_PENTIUM) || defined (__amd64__) || defined (__x86_64__))
52 # define ACE_HAS_INTEL_ASSEMBLY
55 #if !defined (ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE)
56 #define ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE 1
59 #if !defined (ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE)
60 #define ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE 1
63 #if !defined (ACE_HAS_GCC_DEPRECATED_ATTRIBUTE)
64 #define ACE_HAS_GCC_DEPRECATED_ATTRIBUTE 1
67 #if !defined (ACE_HAS_GCC_FORMAT_ATTRIBUTE)
68 #define ACE_HAS_GCC_FORMAT_ATTRIBUTE 1
71 #if (ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE == 1)
72 # define ACE_GCC_CONSTRUCTOR_ATTRIBUTE __attribute__ ((constructor))
75 #if (ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE == 1)
76 # define ACE_GCC_DESTRUCTOR_ATTRIBUTE __attribute__ ((destructor))
79 #if (ACE_HAS_GCC_DEPRECATED_ATTRIBUTE == 1)
80 #define ACE_DEPRECATED __attribute__ ((deprecated))
83 #if (ACE_HAS_GCC_FORMAT_ATTRIBUTE == 1)
84 # define ACE_GCC_FORMAT_ATTRIBUTE(TYPE, STR_INDEX, FIRST_INDEX) \
85 __attribute__ ((format (TYPE, STR_INDEX, FIRST_INDEX)))
88 // Take advantage of g++ visibility attributes to generate
89 // improved shared library binaries.
90 #if !defined (__MINGW32__)
92 # if defined (ACE_HAS_CUSTOM_EXPORT_MACROS) && ACE_HAS_CUSTOM_EXPORT_MACROS == 0
93 # undef ACE_HAS_CUSTOM_EXPORT_MACROS
94 # if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS)
95 # undef ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS
96 # endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */
97 # define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 0
99 # ifndef ACE_HAS_CUSTOM_EXPORT_MACROS
100 # define ACE_HAS_CUSTOM_EXPORT_MACROS
101 # endif /* !ACE_HAS_CUSTOM_EXPORT_MACROS */
102 # ifndef ACE_Proper_Export_Flag
103 # define ACE_Proper_Export_Flag __attribute__ ((visibility("default")))
104 # endif /* !ACE_Proper_Export_Flag */
105 # ifndef ACE_Proper_Import_Flag
106 # define ACE_Proper_Import_Flag __attribute__ ((visibility("default")))
107 # endif /* !ACE_Proper_Import_Flag */
109 # ifndef ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS
110 # define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 1
113 # if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS) && ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS == 1
114 # define ACE_EXPORT_SINGLETON_DECLARATION(T) __extension__ extern template class ACE_Proper_Export_Flag T
115 # define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class ACE_Proper_Export_Flag SINGLETON_TYPE <CLASS, LOCK>;
116 # define ACE_HAS_EXPLICIT_TEMPLATE_CLASS_INSTANTIATION
117 # else /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */
118 # define ACE_EXPORT_SINGLETON_DECLARATION(T) \
119 _Pragma ("GCC visibility push(default)") \
121 _Pragma ("GCC visibility pop")
122 # define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) \
123 _Pragma ("GCC visibility push(default)") \
124 template class SINGLETON_TYPE<CLASS, LOCK>; \
125 _Pragma ("GCC visibility pop")
126 # endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */
128 // Note that the "__extension__" is needed to prevent g++ from issuing
129 // an error when using its "-pedantic" command line flag.
130 # define ACE_IMPORT_SINGLETON_DECLARATION(T) __extension__ extern template class T
131 # define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class SINGLETON_TYPE<CLASS, LOCK>;
133 # endif /* ACE_HAS_CUSTOM_EXPORT_MACROS == 0 */
134 #endif /* !__MINGW32__ */
136 #if defined (ACE_HAS_THREADS)
137 # if defined (__powerpc__)
138 // The builtins seem to be provided for all powerpc platforms
139 # define ACE_HAS_GCC_ATOMIC_BUILTINS 1
141 # if defined (__ia64)
142 // The builtins seem to be provided for the IA64 platforms
143 # define ACE_HAS_GCC_ATOMIC_BUILTINS 1
145 # if defined (__amd64__) || defined (__x86_64__)
146 // The builtin's are provided also for 64bit linux
147 # define ACE_HAS_GCC_ATOMIC_BUILTINS 1
149 #endif /* ACE_HAS_THREADS */
151 #define ACE_GCC_NO_RETURN __attribute__ ((__noreturn__))
153 #include /**/ "ace/post.h"
154 #endif /* ACE_GNUG_COMMON_H */