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
109 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
110 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
111 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
112 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
121 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
122 _GL_EXTERN_C rettype func parameters_and_attributes
133 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
134 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
135 #if defined __cplusplus && defined GNULIB_NAMESPACE
136 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
137 namespace GNULIB_NAMESPACE \
139 static const struct _gl_ ## func ## _wrapper \
141 typedef rettype (*type) parameters; \
143 inline operator type () const \
149 _GL_EXTERN_C int _gl_cxxalias_dummy
151 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
152 _GL_EXTERN_C int _gl_cxxalias_dummy
162 #define _GL_CXXALIAS_MDA(func,rettype,parameters) \
163 _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
170 #if defined __cplusplus && defined GNULIB_NAMESPACE
171 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
172 namespace GNULIB_NAMESPACE \
174 static const struct _gl_ ## func ## _wrapper \
176 typedef rettype (*type) parameters; \
178 inline operator type () const \
180 return reinterpret_cast<type>(::rpl_func); \
184 _GL_EXTERN_C int _gl_cxxalias_dummy
186 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
187 _GL_EXTERN_C int _gl_cxxalias_dummy
195 #define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
196 _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
208 #if defined __cplusplus && defined GNULIB_NAMESPACE
209 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
210 namespace GNULIB_NAMESPACE \
212 static const struct _gl_ ## func ## _wrapper \
214 typedef rettype (*type) parameters; \
216 inline operator type () const \
222 _GL_EXTERN_C int _gl_cxxalias_dummy
224 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
225 _GL_EXTERN_C int _gl_cxxalias_dummy
233 #if defined __cplusplus && defined GNULIB_NAMESPACE
234 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
235 namespace GNULIB_NAMESPACE \
237 static const struct _gl_ ## func ## _wrapper \
239 typedef rettype (*type) parameters; \
241 inline operator type () const \
243 return reinterpret_cast<type>(::func); \
247 _GL_EXTERN_C int _gl_cxxalias_dummy
249 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
250 _GL_EXTERN_C int _gl_cxxalias_dummy
259 #if defined __cplusplus && defined GNULIB_NAMESPACE
265 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
266 namespace GNULIB_NAMESPACE \
268 static const struct _gl_ ## func ## _wrapper \
270 typedef rettype (*type) parameters; \
272 inline operator type () const \
274 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
278 _GL_EXTERN_C int _gl_cxxalias_dummy
280 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
281 _GL_EXTERN_C int _gl_cxxalias_dummy
288 #if defined __cplusplus && defined GNULIB_NAMESPACE
289 # define _GL_CXXALIASWARN(func) \
290 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
291 # define _GL_CXXALIASWARN_1(func,namespace) \
292 _GL_CXXALIASWARN_2 (func, namespace)
295 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
296 # define _GL_CXXALIASWARN_2(func,namespace) \
297 _GL_WARN_ON_USE (func, \
298 "The symbol ::" #func " refers to the system function. " \
299 "Use " #namespace "::" #func " instead.")
300 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
301 # define _GL_CXXALIASWARN_2(func,namespace) \
302 extern __typeof__ (func) func
304 # define _GL_CXXALIASWARN_2(func,namespace) \
305 _GL_EXTERN_C int _gl_cxxalias_dummy
308 # define _GL_CXXALIASWARN(func) \
309 _GL_EXTERN_C int _gl_cxxalias_dummy
315 #if defined __cplusplus && defined GNULIB_NAMESPACE
316 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
317 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
319 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
320 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
323 # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
324 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
325 _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
326 "The symbol ::" #func " refers to the system function. " \
327 "Use " #namespace "::" #func " instead.")
329 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
330 _GL_EXTERN_C int _gl_cxxalias_dummy
333 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
334 _GL_EXTERN_C int _gl_cxxalias_dummy