From f2c4434b82cbbf9761d192fa9eb945278ac4e931 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 23 Apr 2005 22:27:37 +0000 Subject: [PATCH] From Albert Chin: just define __attribute__ as an empty macro if we don't have __attribute__ support in the compiler. While we're at it, get rid of the declaration of bpf_error() in gencode.c, as it's already declared in gencode.h. --- gencode.c | 4 +--- gencode.h | 11 ++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gencode.c b/gencode.c index 60c2339..37b0222 100644 --- a/gencode.c +++ b/gencode.c @@ -21,7 +21,7 @@ */ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.221.2.6 2005-04-20 18:23:42 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.221.2.7 2005-04-23 22:27:37 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -108,8 +108,6 @@ static u_int orig_linktype = -1U, orig_nl = -1U; static int pcap_fddipad; #endif -void bpf_error(const char *fmt, ...) __attribute__((noreturn)); - /* VARARGS */ void bpf_error(const char *fmt, ...) diff --git a/gencode.h b/gencode.h index eb9ac3d..394bd10 100644 --- a/gencode.h +++ b/gencode.h @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.60.2.1 2005-04-19 04:26:07 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.60.2.2 2005-04-23 22:27:38 guy Exp $ (LBL) */ /* @@ -55,6 +55,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifndef HAVE___ATTRIBUTE__ +#define __attribute__(x) +#endif /* HAVE___ATTRIBUTE__ */ + /* Address qualifiers. */ #define Q_HOST 1 @@ -290,10 +294,7 @@ struct block *gen_pf_dir(int); void bpf_optimize(struct block **); void bpf_error(const char *, ...) -#if HAVE___ATTRIBUTE__ - __attribute__((noreturn, format (printf, 1, 2))) -#endif -; + __attribute__((noreturn, format (printf, 1, 2))); void finish_parse(struct block *); char *sdup(const char *);