1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

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 <gary@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Gary Lockyer 2017-09-29 10:22:20 +13:00 committed by Stefan Metzmacher
parent 6f7b555dad
commit d6a1a849a2
2 changed files with 35 additions and 3 deletions

View File

@ -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"}

View File

@ -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__ */