diff options
Diffstat (limited to 'contrib/texinfo/lib')
-rw-r--r-- | contrib/texinfo/lib/system.h | 15 | ||||
-rw-r--r-- | contrib/texinfo/lib/xalloc.h | 2 | ||||
-rw-r--r-- | contrib/texinfo/lib/xexit.c | 20 |
3 files changed, 26 insertions, 11 deletions
diff --git a/contrib/texinfo/lib/system.h b/contrib/texinfo/lib/system.h index e001f0c..f2bbf22 100644 --- a/contrib/texinfo/lib/system.h +++ b/contrib/texinfo/lib/system.h @@ -1,7 +1,7 @@ /* system.h: system-dependent declarations; include this first. - $Id: system.h,v 1.4 2002/10/31 13:44:06 karl Exp $ + $Id: system.h,v 1.5 2003/03/22 17:40:39 karl Exp $ - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -258,4 +258,15 @@ extern void xexit (); /* For convenience. */ #define STREQ(s1,s2) (strcmp (s1, s2) == 0) +/* We don't need anything fancy. If we did need something fancy, gnulib + has it. */ +#ifdef MIN +#undef MIN +#endif +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#ifdef MAX +#undef MAX +#endif +#define MAX(a,b) ((a) > (b) ? (a) : (b)) + #endif /* TEXINFO_SYSTEM_H */ diff --git a/contrib/texinfo/lib/xalloc.h b/contrib/texinfo/lib/xalloc.h index 098a6c2..5b623da 100644 --- a/contrib/texinfo/lib/xalloc.h +++ b/contrib/texinfo/lib/xalloc.h @@ -18,6 +18,8 @@ #ifndef XALLOC_H_ # define XALLOC_H_ +# include <stddef.h> + # ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args diff --git a/contrib/texinfo/lib/xexit.c b/contrib/texinfo/lib/xexit.c index fafe4b3..fa783b3 100644 --- a/contrib/texinfo/lib/xexit.c +++ b/contrib/texinfo/lib/xexit.c @@ -1,7 +1,7 @@ /* xexit.c -- exit with attention to return values and closing stdout. - $Id: xexit.c,v 1.1 2002/08/25 23:38:38 karl Exp $ + $Id: xexit.c,v 1.4 2003/05/19 13:10:59 karl Exp $ - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2003 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 @@ -41,26 +41,28 @@ #endif /* not EXIT_SUCCESS */ -/* Flush stdout first, exit if failure. Otherwise, if EXIT_STATUS is - zero, exit successfully, else unsuccessfully. */ - +/* Flush stdout first, exit if failure (therefore, xexit should be + called to exit every program, not just `return' from main). + Otherwise, if EXIT_STATUS is zero, exit successfully, else + unsuccessfully. */ + void xexit (exit_status) int exit_status; { if (ferror (stdout)) { - fprintf (stderr, "ferror on stdout"); + fputs (_("ferror on stdout\n"), stderr); exit_status = 1; } else if (fflush (stdout) != 0) { - fprintf (stderr, "fflush error on stdout"); + fputs (_("fflush error on stdout\n"), stderr); exit_status = 1; } - + exit_status = exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE; - + exit (exit_status); } |