Mercurial > hg > octave-kai > gnulib-hg
annotate lib/error.h @ 3328:d60092d448ec
(__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
to get in sync with glibc.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 04 Aug 2001 17:52:38 +0000 (2001-08-04) |
parents | 523ec79fa3b1 |
children | 8b869710f671 |
rev | line source |
---|---|
1268 | 1 /* Declaration for error-reporting function |
2950
523ec79fa3b1
Remove "2000" from Copyright line, as the file hasn't been
Jim Meyering <jim@meyering.net>
parents:
2449
diff
changeset
|
2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. |
1268 | 3 |
402 | 4 |
1268 | 5 NOTE: The canonical source of this file is maintained with the GNU C Library. |
6 Bugs can be reported to bug-glibc@prep.ai.mit.edu. | |
7 | |
8 This program is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
10 Free Software Foundation; either version 2, or (at your option) any | |
11 later version. | |
402 | 12 |
725 | 13 This program is distributed in the hope that it will be useful, |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 GNU General Public License for more details. | |
572 | 17 |
725 | 18 You should have received a copy of the GNU General Public License |
1268 | 19 along with this program; if not, write to the Free Software |
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
21 USA. */ | |
367 | 22 |
1268 | 23 #ifndef _ERROR_H |
24 #define _ERROR_H 1 | |
25 | |
26 #ifndef __attribute__ | |
411
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
27 /* This feature is available in gcc versions 2.5 and later. */ |
3328
d60092d448ec
(__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
Jim Meyering <jim@meyering.net>
parents:
2950
diff
changeset
|
28 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) |
1268 | 29 # define __attribute__(Spec) /* empty */ |
30 # endif | |
411
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
31 /* The __-protected variants of `format' and `printf' attributes |
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
32 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ |
1268 | 33 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) |
34 # define __format__ format | |
35 # define __printf__ printf | |
411
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
36 # endif |
1268 | 37 #endif |
402 | 38 |
1268 | 39 #ifdef __cplusplus |
40 extern "C" { | |
41 #endif | |
42 | |
43 #if defined (__STDC__) && __STDC__ | |
572 | 44 |
45 /* Print a message with `fprintf (stderr, FORMAT, ...)'; | |
46 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). | |
47 If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ | |
48 | |
49 extern void error (int status, int errnum, const char *format, ...) | |
50 __attribute__ ((__format__ (__printf__, 3, 4))); | |
51 | |
52 extern void error_at_line (int status, int errnum, const char *fname, | |
53 unsigned int lineno, const char *format, ...) | |
54 __attribute__ ((__format__ (__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 | |
58 function without parameters instead. */ | |
59 extern void (*error_print_progname) (void); | |
60 | |
1268 | 61 #else |
367 | 62 void error (); |
572 | 63 void error_at_line (); |
64 extern void (*error_print_progname) (); | |
1268 | 65 #endif |
367 | 66 |
440 | 67 /* This variable is incremented each time `error' is called. */ |
68 extern unsigned int error_message_count; | |
69 | |
572 | 70 /* Sometimes we want to have at most one error per line. This |
71 variable controls whether this mode is selected or not. */ | |
72 extern int error_one_per_line; | |
73 | |
1268 | 74 #ifdef __cplusplus |
75 } | |
76 #endif | |
77 | |
78 #endif /* error.h */ |