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 >= 202302L
18 # define ACE_HAS_CPP23
20 #if __cplusplus >= 202002L
21 # define ACE_HAS_CPP20
23 #if __cplusplus >= 201703L
24 # define ACE_HAS_CPP17
26 #if __cplusplus >= 201402L
27 # define ACE_HAS_CPP14
29 #if __cplusplus >= 201103L
30 # define ACE_HAS_CPP11
33 #if (defined (i386) || defined (__i386__)) && !defined (ACE_SIZEOF_LONG_DOUBLE)
34 # define ACE_SIZEOF_LONG_DOUBLE 12
37 #if !defined (__MINGW32__) && (defined (i386) || defined (__i386__))
38 // If running an Intel, assume that it's a Pentium so that
39 // ACE_OS::gethrtime () can use the RDTSC instruction. If running a
40 // 486 or lower, be sure to comment this out. (If not running an
41 // Intel CPU, this #define will not be seen because of the i386
42 // protection, so it can be ignored.)
43 # define ACE_HAS_PENTIUM
46 #if (defined (ACE_HAS_PENTIUM) || defined (__amd64__) || defined (__x86_64__))
47 # define ACE_HAS_INTEL_ASSEMBLY
50 #if !defined (ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE)
51 #define ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE 1
54 #if !defined (ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE)
55 #define ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE 1
58 #if !defined (ACE_HAS_GCC_FORMAT_ATTRIBUTE)
59 #define ACE_HAS_GCC_FORMAT_ATTRIBUTE 1
62 #if (ACE_HAS_GCC_CONSTRUCTOR_ATTRIBUTE == 1)
63 # define ACE_GCC_CONSTRUCTOR_ATTRIBUTE __attribute__ ((constructor))
66 #if (ACE_HAS_GCC_DESTRUCTOR_ATTRIBUTE == 1)
67 # define ACE_GCC_DESTRUCTOR_ATTRIBUTE __attribute__ ((destructor))
70 #if (ACE_HAS_GCC_FORMAT_ATTRIBUTE == 1)
71 # define ACE_GCC_FORMAT_ATTRIBUTE(TYPE, STR_INDEX, FIRST_INDEX) \
72 __attribute__ ((format (TYPE, STR_INDEX, FIRST_INDEX)))
75 // Take advantage of g++ visibility attributes to generate
76 // improved shared library binaries.
77 #if !defined (__MINGW32__)
79 # if defined (ACE_HAS_CUSTOM_EXPORT_MACROS) && ACE_HAS_CUSTOM_EXPORT_MACROS == 0
80 # undef ACE_HAS_CUSTOM_EXPORT_MACROS
81 # if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS)
82 # undef ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS
83 # endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */
84 # define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 0
86 # ifndef ACE_HAS_CUSTOM_EXPORT_MACROS
87 # define ACE_HAS_CUSTOM_EXPORT_MACROS
88 # endif /* !ACE_HAS_CUSTOM_EXPORT_MACROS */
89 # ifndef ACE_Proper_Export_Flag
90 # define ACE_Proper_Export_Flag __attribute__ ((visibility("default")))
91 # endif /* !ACE_Proper_Export_Flag */
92 # ifndef ACE_Proper_Import_Flag
93 # define ACE_Proper_Import_Flag __attribute__ ((visibility("default")))
94 # endif /* !ACE_Proper_Import_Flag */
96 # ifndef ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS
97 # define ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS 1
100 # if defined (ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS) && ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS == 1
101 # define ACE_EXPORT_SINGLETON_DECLARATION(T) __extension__ extern template class ACE_Proper_Export_Flag T
102 # define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class ACE_Proper_Export_Flag SINGLETON_TYPE <CLASS, LOCK>;
103 # define ACE_HAS_EXPLICIT_TEMPLATE_CLASS_INSTANTIATION
104 # else /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */
105 # define ACE_EXPORT_SINGLETON_DECLARATION(T) \
106 _Pragma ("GCC visibility push(default)") \
108 _Pragma ("GCC visibility pop")
109 # define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) \
110 _Pragma ("GCC visibility push(default)") \
111 template class SINGLETON_TYPE<CLASS, LOCK>; \
112 _Pragma ("GCC visibility pop")
113 # endif /* ACE_GCC_HAS_TEMPLATE_INSTANTIATION_VISIBILITY_ATTRS */
115 // Note that the "__extension__" is needed to prevent g++ from issuing
116 // an error when using its "-pedantic" command line flag.
117 # define ACE_IMPORT_SINGLETON_DECLARATION(T) __extension__ extern template class T
118 # define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) __extension__ extern template class SINGLETON_TYPE<CLASS, LOCK>;
120 # endif /* ACE_HAS_CUSTOM_EXPORT_MACROS == 0 */
121 #endif /* !__MINGW32__ */
123 #if defined (ACE_HAS_THREADS)
124 # if defined (__powerpc__)
125 // The builtins seem to be provided for all powerpc platforms
126 # define ACE_HAS_GCC_ATOMIC_BUILTINS 1
128 # if defined (__ia64)
129 // The builtins seem to be provided for the IA64 platforms
130 # define ACE_HAS_GCC_ATOMIC_BUILTINS 1
132 # if defined (__amd64__) || defined (__x86_64__)
133 // The builtin's are provided also for 64bit linux
134 # define ACE_HAS_GCC_ATOMIC_BUILTINS 1
136 #endif /* ACE_HAS_THREADS */
138 #define ACE_GCC_NO_RETURN __attribute__ ((__noreturn__))
140 #include /**/ "ace/post.h"
141 #endif /* ACE_GNUG_COMMON_H */