From: Björn Jacke Date: Thu, 8 Oct 2020 10:21:31 +0000 (+0200) Subject: tevent: also use portable __has_attribute macro to check for "deprecated" attribute X-Git-Tag: talloc-2.3.2~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c56c5c17fd4f5764935ee6a4cd90b9c0a2c525b4;p=thirdparty%2Fsamba.git tevent: also use portable __has_attribute macro to check for "deprecated" attribute BUG: https://bugzilla.samba.org/show_bug.cgi?id=14526 Signed-off-by: Bjoern Jacke Reviewed-by: Andrew Bartlett --- diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h index dc68a1d3f69..b8e46feec46 100644 --- a/lib/tevent/tevent.h +++ b/lib/tevent/tevent.h @@ -33,6 +33,12 @@ #include #include +/* for old gcc releases that don't have the feature test macro __has_attribute */ +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif + + struct tevent_context; struct tevent_ops; struct tevent_fd; @@ -2076,7 +2082,7 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx, #ifdef TEVENT_DEPRECATED #ifndef _DEPRECATED_ -#ifdef HAVE___ATTRIBUTE__ +#if __has_attribute(deprecated) || (__GNUC__ >= 3) #define _DEPRECATED_ __attribute__ ((deprecated)) #else #define _DEPRECATED_