]> git.wh0rd.org Git - patches.git/blob - glibc-error-header-updates.patch
initial import
[patches.git] / glibc-error-header-updates.patch
1 2006-04-07  Mike Frysinger  <vapier@gentoo.org>
2
3         * misc/error.h (__attribute__): Rename to __error_attribute__.
4         (__format__): Rename to __error_format__.
5         (__printf__): Rename to __error_printf__.
6         (error): Update prototype to use new names.
7         (error_at_line): Likewise.
8
9 --- misc/error.h
10 +++ misc/error.h
11 @@ -1,5 +1,5 @@
12  /* Declaration for error-reporting function
13 -   Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
14 +   Copyright (C) 1995, 1996, 1997, 2003, 2006 Free Software Foundation, Inc.
15     This file is part of the GNU C Library.
16  
17     The GNU C Library is free software; you can redistribute it and/or
18 @@ -20,16 +20,21 @@
19  #ifndef _ERROR_H
20  #define _ERROR_H 1
21  
22 -#ifndef __attribute__
23 +#ifndef __error_attribute__
24  /* This feature is available in gcc versions 2.5 and later.  */
25  # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
26 -#  define __attribute__(Spec) /* empty */
27 +#  define __error_attribute__(Spec) /* empty */
28 +# else
29 +#  define __error_attribute__(Spec) __attribute__(Spec)
30  # endif
31  /* The __-protected variants of `format' and `printf' attributes
32     are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
33  # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
34 -#  define __format__ format
35 -#  define __printf__ printf
36 +#  define __error_format__ format
37 +#  define __error_printf__ printf
38 +# else
39 +#  define __error_format__ __format__
40 +#  define __error_printf__ __printf__
41  # endif
42  #endif
43  
44 @@ -44,11 +49,11 @@ extern "C" {
45     If STATUS is nonzero, terminate the program with `exit (STATUS)'.  */
46  
47  extern void error (int __status, int __errnum, const char *__format, ...)
48 -     __attribute__ ((__format__ (__printf__, 3, 4)));
49 +     __error_attribute__ ((__error_format__ (__error_printf__, 3, 4)));
50  
51  extern void error_at_line (int __status, int __errnum, const char *__fname,
52                            unsigned int __lineno, const char *__format, ...)
53 -     __attribute__ ((__format__ (__printf__, 5, 6)));
54 +     __error_attribute__ ((__error_format__ (__error_printf__, 5, 6)));
55  
56  /* If NULL, error will flush stdout, then print on stderr the program
57     name, a colon and a space.  Otherwise, error will call this