21 #if defined __cplusplus && defined GNULIB_NAMESPACE
22 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
23 # define _GL_END_NAMESPACE }
25 # define _GL_BEGIN_NAMESPACE
26 # define _GL_END_NAMESPACE
90 #if defined __cplusplus
91 # define _GL_EXTERN_C extern "C"
93 # define _GL_EXTERN_C extern
103 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
104 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
105 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
106 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
115 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
116 _GL_EXTERN_C rettype func parameters_and_attributes
127 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
128 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
129 #if defined __cplusplus && defined GNULIB_NAMESPACE
130 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
131 namespace GNULIB_NAMESPACE \
133 static const struct _gl_ ## func ## _wrapper \
135 typedef rettype (*type) parameters; \
137 inline operator type () const \
143 _GL_EXTERN_C int _gl_cxxalias_dummy
145 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
146 _GL_EXTERN_C int _gl_cxxalias_dummy
154 #if defined __cplusplus && defined GNULIB_NAMESPACE
155 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
156 namespace GNULIB_NAMESPACE \
158 static const struct _gl_ ## func ## _wrapper \
160 typedef rettype (*type) parameters; \
162 inline operator type () const \
164 return reinterpret_cast<type>(::rpl_func); \
168 _GL_EXTERN_C int _gl_cxxalias_dummy
170 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
171 _GL_EXTERN_C int _gl_cxxalias_dummy
184 #if defined __cplusplus && defined GNULIB_NAMESPACE
185 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
186 namespace GNULIB_NAMESPACE \
188 static const struct _gl_ ## func ## _wrapper \
190 typedef rettype (*type) parameters; \
192 inline operator type () const \
198 _GL_EXTERN_C int _gl_cxxalias_dummy
200 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
201 _GL_EXTERN_C int _gl_cxxalias_dummy
209 #if defined __cplusplus && defined GNULIB_NAMESPACE
210 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
211 namespace GNULIB_NAMESPACE \
213 static const struct _gl_ ## func ## _wrapper \
215 typedef rettype (*type) parameters; \
217 inline operator type () const \
219 return reinterpret_cast<type>(::func); \
223 _GL_EXTERN_C int _gl_cxxalias_dummy
225 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
226 _GL_EXTERN_C int _gl_cxxalias_dummy
235 #if defined __cplusplus && defined GNULIB_NAMESPACE
241 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
242 namespace GNULIB_NAMESPACE \
244 static const struct _gl_ ## func ## _wrapper \
246 typedef rettype (*type) parameters; \
248 inline operator type () const \
250 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
254 _GL_EXTERN_C int _gl_cxxalias_dummy
256 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
257 _GL_EXTERN_C int _gl_cxxalias_dummy
264 #if defined __cplusplus && defined GNULIB_NAMESPACE
265 # define _GL_CXXALIASWARN(func) \
266 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
267 # define _GL_CXXALIASWARN_1(func,namespace) \
268 _GL_CXXALIASWARN_2 (func, namespace)
272 # define _GL_CXXALIASWARN_2(func,namespace) \
273 _GL_WARN_ON_USE (func, \
274 "The symbol ::" #func " refers to the system function. " \
275 "Use " #namespace "::" #func " instead.")
276 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
277 # define _GL_CXXALIASWARN_2(func,namespace) \
278 extern __typeof__ (func) func
280 # define _GL_CXXALIASWARN_2(func,namespace) \
281 _GL_EXTERN_C int _gl_cxxalias_dummy
284 # define _GL_CXXALIASWARN(func) \
285 _GL_EXTERN_C int _gl_cxxalias_dummy
291 #if defined __cplusplus && defined GNULIB_NAMESPACE
292 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
293 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
295 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
296 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
300 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
301 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
302 "The symbol ::" #func " refers to the system function. " \
303 "Use " #namespace "::" #func " instead.")
304 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
305 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
306 extern __typeof__ (func) func
308 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
309 _GL_EXTERN_C int _gl_cxxalias_dummy
312 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
313 _GL_EXTERN_C int _gl_cxxalias_dummy