]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(__attribute__, ATTRIBUTE_UNUSED): Define.
authorJim Meyering <jim@meyering.net>
Sat, 9 Apr 2005 14:08:57 +0000 (14:08 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 9 Apr 2005 14:08:57 +0000 (14:08 +0000)
(exit_failure_callback, fallback_failure_callback): Mark unused
parameters with ATTRIBUTE_UNUSED.

lib/unicodeio.c

index 4f0792bb68696d6ab0c7a5d7fbe138abb59d49ca..b2085d599fcae728c4627c19affb757809eafa71 100644 (file)
@@ -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;