diff --git a/lib/gssapi/gssapi/gssapi.h b/lib/gssapi/gssapi/gssapi.h index 91141808f..357b98972 100644 --- a/lib/gssapi/gssapi/gssapi.h +++ b/lib/gssapi/gssapi/gssapi.h @@ -63,6 +63,14 @@ #endif #endif +#ifdef __cplusplus +#define GSSAPI_CPP_START extern "C" { +#define GSSAPI_CPP_END } +#else +#define GSSAPI_CPP_START +#define GSSAPI_CPP_END +#endif + /* * Now define the three implementation-dependent types. */ @@ -243,9 +251,7 @@ typedef OM_uint32 gss_qop_t; #define GSS_IOV_BUFFER_TYPE(_t) ((_t) & ~GSS_IOV_BUFFER_TYPE_FLAG_MASK) #define GSS_IOV_BUFFER_FLAGS(_t) ((_t) & GSS_IOV_BUFFER_TYPE_FLAG_MASK) -#ifdef __cplusplus -extern "C" { -#endif +GSSAPI_CPP_START /* * The implementation must reserve static storage for a @@ -894,8 +900,6 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_release_iov_buffer(OM_uint32 *, gss_iov_buffer_desc *, int); -#ifdef __cplusplus -} -#endif +GSSAPI_CPP_END #endif /* GSSAPI_GSSAPI_H_ */ diff --git a/lib/gssapi/gssapi/gssapi_krb5.h b/lib/gssapi/gssapi/gssapi_krb5.h index 0baccf509..4d004d90b 100644 --- a/lib/gssapi/gssapi/gssapi_krb5.h +++ b/lib/gssapi/gssapi/gssapi_krb5.h @@ -38,9 +38,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif +GSSAPI_CPP_START #if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(x) @@ -246,8 +244,6 @@ gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status, OM_uint32 num_enctypes, int32_t *enctypes); -#ifdef __cplusplus -} -#endif +GSSAPI_CPP_END #endif /* GSSAPI_SPNEGO_H_ */ diff --git a/lib/gssapi/gssapi/gssapi_ntlm.h b/lib/gssapi/gssapi/gssapi_ntlm.h index 826ea72f1..28ab974db 100644 --- a/lib/gssapi/gssapi/gssapi_ntlm.h +++ b/lib/gssapi/gssapi/gssapi_ntlm.h @@ -38,14 +38,10 @@ #include -#ifdef __cplusplus -extern "C" { -#endif +GSSAPI_CPP_START extern GSSAPI_LIB_VARIABLE gss_OID GSS_NTLM_MECHANISM; -#ifdef __cplusplus -} -#endif +GSSAPI_CPP_END #endif /* GSSAPI_NTLM_H_ */ diff --git a/lib/gssapi/gssapi/gssapi_spnego.h b/lib/gssapi/gssapi/gssapi_spnego.h index 3c4869f08..c5d372d6d 100644 --- a/lib/gssapi/gssapi/gssapi_spnego.h +++ b/lib/gssapi/gssapi/gssapi_spnego.h @@ -38,9 +38,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif +GSSAPI_CPP_START /* * RFC2478, SPNEGO: @@ -51,8 +49,6 @@ extern "C" { extern GSSAPI_LIB_VARIABLE gss_OID GSS_SPNEGO_MECHANISM; #define gss_mech_spnego GSS_SPNEGO_MECHANISM -#ifdef __cplusplus -} -#endif +GSSAPI_CPP_END #endif /* GSSAPI_SPNEGO_H_ */