|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _GL_CXXDEFS_H |
|
#define _GL_CXXDEFS_H |
|
|
|
|
|
#if defined __cplusplus && defined GNULIB_NAMESPACE |
|
# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { |
|
# define _GL_END_NAMESPACE } |
|
#else |
|
# define _GL_BEGIN_NAMESPACE |
|
# define _GL_END_NAMESPACE |
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined __cplusplus |
|
# define _GL_EXTERN_C extern "C" |
|
#else |
|
# define _GL_EXTERN_C extern |
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ |
|
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) |
|
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ |
|
_GL_EXTERN_C rettype rpl_func parameters_and_attributes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ |
|
_GL_EXTERN_C rettype func parameters_and_attributes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ |
|
_GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) |
|
#if defined __cplusplus && defined GNULIB_NAMESPACE |
|
# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ |
|
namespace GNULIB_NAMESPACE \ |
|
{ \ |
|
static const struct _gl_ ## func ## _wrapper \ |
|
{ \ |
|
typedef rettype (*type) parameters; \ |
|
\ |
|
inline operator type () const \ |
|
{ \ |
|
return ::rpl_func; \ |
|
} \ |
|
} func = {}; \ |
|
} \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#else |
|
# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ |
|
_GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) |
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined __cplusplus && defined GNULIB_NAMESPACE |
|
# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ |
|
namespace GNULIB_NAMESPACE \ |
|
{ \ |
|
static const struct _gl_ ## func ## _wrapper \ |
|
{ \ |
|
typedef rettype (*type) parameters; \ |
|
\ |
|
inline operator type () const \ |
|
{ \ |
|
return reinterpret_cast<type>(::rpl_func); \ |
|
} \ |
|
} func = {}; \ |
|
} \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#else |
|
# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ |
|
_GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined __cplusplus && defined GNULIB_NAMESPACE |
|
# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ |
|
namespace GNULIB_NAMESPACE \ |
|
{ \ |
|
static const struct _gl_ ## func ## _wrapper \ |
|
{ \ |
|
typedef rettype (*type) parameters; \ |
|
\ |
|
inline operator type () const \ |
|
{ \ |
|
return ::func; \ |
|
} \ |
|
} func = {}; \ |
|
} \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#else |
|
# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined __cplusplus && defined GNULIB_NAMESPACE |
|
# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ |
|
namespace GNULIB_NAMESPACE \ |
|
{ \ |
|
static const struct _gl_ ## func ## _wrapper \ |
|
{ \ |
|
typedef rettype (*type) parameters; \ |
|
\ |
|
inline operator type () const \ |
|
{ \ |
|
return reinterpret_cast<type>(::func); \ |
|
} \ |
|
} func = {}; \ |
|
} \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#else |
|
# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined __cplusplus && defined GNULIB_NAMESPACE |
|
|
|
|
|
|
|
|
|
|
|
# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ |
|
namespace GNULIB_NAMESPACE \ |
|
{ \ |
|
static const struct _gl_ ## func ## _wrapper \ |
|
{ \ |
|
typedef rettype (*type) parameters; \ |
|
\ |
|
inline operator type () const \ |
|
{ \ |
|
return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ |
|
} \ |
|
} func = {}; \ |
|
} \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#else |
|
# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if defined __cplusplus && defined GNULIB_NAMESPACE |
|
# define _GL_CXXALIASWARN(func) \ |
|
_GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) |
|
# define _GL_CXXALIASWARN_1(func,namespace) \ |
|
_GL_CXXALIASWARN_2 (func, namespace) |
|
|
|
|
|
# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) |
|
# define _GL_CXXALIASWARN_2(func,namespace) \ |
|
_GL_WARN_ON_USE (func, \ |
|
"The symbol ::" #func " refers to the system function. " \ |
|
"Use " #namespace "::" #func " instead.") |
|
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING |
|
# define _GL_CXXALIASWARN_2(func,namespace) \ |
|
extern __typeof__ (func) func |
|
# else |
|
# define _GL_CXXALIASWARN_2(func,namespace) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
# endif |
|
#else |
|
# define _GL_CXXALIASWARN(func) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#endif |
|
|
|
|
|
|
|
|
|
#if defined __cplusplus && defined GNULIB_NAMESPACE |
|
# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ |
|
_GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ |
|
GNULIB_NAMESPACE) |
|
# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ |
|
_GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) |
|
|
|
|
|
# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) |
|
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ |
|
_GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ |
|
"The symbol ::" #func " refers to the system function. " \ |
|
"Use " #namespace "::" #func " instead.") |
|
# else |
|
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
# endif |
|
#else |
|
# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ |
|
_GL_EXTERN_C int _gl_cxxalias_dummy |
|
#endif |
|
|
|
#endif |
|
|