From: Gary Lockyer Date: Thu, 28 Sep 2017 21:22:20 +0000 (+1300) Subject: heimdal_build: Use HAVE___ATTRIBUTE__ for unused, noreturn and unused_result X-Git-Tag: tdb-1.4.6~490 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6a1a849a2aec1172ead1b85482b4cea37cd10bd;p=thirdparty%2Fsamba.git heimdal_build: Use HAVE___ATTRIBUTE__ for unused, noreturn and unused_result [abartlet@samba.org Squashed with TODO commit from Gary that provided HEIMDAL_UNUSED_ATTRIBUTE etc] Signed-off-by: Gary Lockyer Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/source4/heimdal_build/config.h b/source4/heimdal_build/config.h index fb43cdc1319..d9ba31b3b45 100644 --- a/source4/heimdal_build/config.h +++ b/source4/heimdal_build/config.h @@ -9,9 +9,6 @@ #include "include/config.h" #include "../replace/replace.h" #include "../lib/util/attr.h" -#define HEIMDAL_NORETURN_ATTRIBUTE _NORETURN_ -#define HEIMDAL_PRINTF_ATTRIBUTE(x) FORMAT_ATTRIBUTE(x) -#define HEIMDAL_UNUSED_ATTRIBUTE _UNUSED_ #define VERSIONLIST {"Lorikeet-Heimdal, Modified for Samba4"} diff --git a/source4/heimdal_build/include/krb5-types.h b/source4/heimdal_build/include/krb5-types.h index 7e9972b8a6a..62a54dd9722 100644 --- a/source4/heimdal_build/include/krb5-types.h +++ b/source4/heimdal_build/include/krb5-types.h @@ -16,6 +16,41 @@ typedef int krb5_socket_t; typedef ssize_t krb5_ssize_t; #endif + +#ifndef HEIMDAL_DEPRECATED +#define HEIMDAL_DEPRECATED _DEPRECATED_ +#endif + +#ifndef HEIMDAL_PRINTF_ATTRIBUTE +#ifdef HAVE_ATTRIBUTE_PRINTF +#define HEIMDAL_PRINTF_ATTRIBUTE(x) __attribute__((format x)) +#else +#define HEIMDAL_PRINTF_ATTRIBUTE(x) +#endif +#endif + +#ifndef HEIMDAL_NORETURN_ATTRIBUTE +#ifdef HAVE___ATTRIBUTE__ +#define HEIMDAL_NORETURN_ATTRIBUTE __attribute__((noreturn)) +#else +#define HEIMDAL_NORETURN_ATTRIBUTE +#endif +#endif + +#ifndef HEIMDAL_UNUSED_ATTRIBUTE +#ifdef HAVE___ATTRIBUTE__ +#define HEIMDAL_UNUSED_ATTRIBUTE __attribute__((unused)) +#else +#define HEIMDAL_UNUSED_ATTRIBUTE +#endif +#endif + +#ifndef HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE +#ifdef HAVE___ATTRIBUTE__ #define HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE _WARN_UNUSED_RESULT_ +#else +#define HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE +#endif +#endif #endif /* __samb_krb5_types_h__ */