From c522a489df8b7f6c95dde2a8f7ada8246fae3f1b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 9 Apr 2005 14:08:57 +0000 Subject: [PATCH] (__attribute__, ATTRIBUTE_UNUSED): Define. (exit_failure_callback, fallback_failure_callback): Mark unused parameters with ATTRIBUTE_UNUSED. --- lib/unicodeio.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/unicodeio.c b/lib/unicodeio.c index 4f0792bb68..b2085d599f 100644 --- a/lib/unicodeio.c +++ b/lib/unicodeio.c @@ -1,6 +1,6 @@ /* Unicode character output to streams with locale dependent encoding. - Copyright (C) 2000-2003 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,6 +46,16 @@ extern int errno; #define _(msgid) gettext (msgid) #define N_(msgid) msgid +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) /* empty */ +# endif +#endif + +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + #include "localcharset.h" /* When we pass a Unicode character to iconv(), we must pass it in a @@ -213,7 +223,8 @@ fwrite_success_callback (const char *buf, size_t buflen, void *callback_arg) /* Simple failure callback that displays an error and exits. */ static long -exit_failure_callback (unsigned int code, const char *msg, void *callback_arg) +exit_failure_callback (unsigned int code, const char *msg, + void *callback_arg ATTRIBUTE_UNUSED) { if (msg == NULL) error (1, 0, _("cannot convert U+%04X to local character set"), code); @@ -226,7 +237,8 @@ exit_failure_callback (unsigned int code, const char *msg, void *callback_arg) /* Simple failure callback that displays a fallback representation in plain ASCII, using the same notation as ISO C99 strings. */ static long -fallback_failure_callback (unsigned int code, const char *msg, void *callback_arg) +fallback_failure_callback (unsigned int code, const char *msg ATTRIBUTE_UNUSED + , void *callback_arg) { FILE *stream = (FILE *) callback_arg; -- 2.47.3