summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-04-09 14:08:57 +0000
committerJim Meyering <jim@meyering.net>2005-04-09 14:08:57 +0000
commitc522a489df8b7f6c95dde2a8f7ada8246fae3f1b (patch)
tree6d75488aa6886e75461b0d975dbe2169bb187d81 /lib
parent22210b83b46d5c0656f722e92661145c100b0c3a (diff)
downloadcoreutils-c522a489df8b7f6c95dde2a8f7ada8246fae3f1b.tar.xz
(__attribute__, ATTRIBUTE_UNUSED): Define.
(exit_failure_callback, fallback_failure_callback): Mark unused parameters with ATTRIBUTE_UNUSED.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicodeio.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/unicodeio.c b/lib/unicodeio.c
index 4f0792bb6..b2085d599 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;