1 /* Copyright (C) 1991, 1993, 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
21 static char iferrno
[] = "#ifdef _ERRNO_H";
22 static char endiferrno
[] = "#endif /* <errno.h> included. */";
23 static char ifEmath
[] = "#if !defined(__Emath_defined) && \
24 (defined(_ERRNO_H) || defined(__need_Emath))";
25 static char endifEmath
[] = "#endif /* Emath not defined and <errno.h> \
26 included or need Emath. */";
28 static int biggest_value
= 0;
29 static int done_ENOSYS
= 0;
30 static int done_ERANGE
= 0, done_EDOM
= 0;
37 int is_ERANGE
= !done_ERANGE
&& !strcmp(name
, "ERANGE");
38 int is_EDOM
= !done_EDOM
&& !strcmp(name
, "EDOM");
39 int is_Emath
= is_ERANGE
|| is_EDOM
;
47 if (!strcmp (name
, "EWOULDBLOCK"))
49 puts ("#define EWOULDBLOCK EAGAIN /* Translated in glibc. */");
50 name
= "EWOULDBLOCK_sys /* Value actually returned by kernel. */";
53 printf ("#define %s %d\n", name
, value
);
61 if (value
> biggest_value
)
62 biggest_value
= value
;
68 else if (!done_ENOSYS
&& !strcmp(name
, "ENOSYS"))
79 if (!done_EDOM
|| !done_ERANGE
)
84 printf("#define EDOM %d\n", ++biggest_value
);
86 printf("#define ERANGE %d\n", ++biggest_value
);
91 printf("#define ENOSYS %d\n", ++biggest_value
);
95 puts("#undef __need_Emath");
96 puts("#ifndef __Emath_defined\n#define __Emath_defined 1\n#endif");