error, strerror-override: Support mingw64 from Fedora 17.
[gnulib.git] / lib / errno.in.h
1 /* A POSIX-like <errno.h>.
2
3    Copyright (C) 2008-2012 Free Software Foundation, Inc.
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2, or (at your option)
8    any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, see <http://www.gnu.org/licenses/>.  */
17
18 #ifndef _@GUARD_PREFIX@_ERRNO_H
19
20 #if __GNUC__ >= 3
21 @PRAGMA_SYSTEM_HEADER@
22 #endif
23 @PRAGMA_COLUMNS@
24
25 /* The include_next requires a split double-inclusion guard.  */
26 #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
27
28 #ifndef _@GUARD_PREFIX@_ERRNO_H
29 #define _@GUARD_PREFIX@_ERRNO_H
30
31
32 /* On native Windows platforms, many macros are not defined.  */
33 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
34
35 /* These are the same values as defined by MSVC 10, for interoperability.  */
36
37 #  ifndef ENOMSG
38 #   define ENOMSG    122
39 #   define GNULIB_defined_ENOMSG 1
40 #  endif
41
42 #  ifndef EIDRM
43 #   define EIDRM     111
44 #   define GNULIB_defined_EIDRM 1
45 #  endif
46
47 #  ifndef ENOLINK
48 #   define ENOLINK   121
49 #   define GNULIB_defined_ENOLINK 1
50 #  endif
51
52 #  ifndef EPROTO
53 #   define EPROTO    134
54 #   define GNULIB_defined_EPROTO 1
55 #  endif
56
57 #  ifndef EBADMSG
58 #   define EBADMSG   104
59 #   define GNULIB_defined_EBADMSG 1
60 #  endif
61
62 #  ifndef EOVERFLOW
63 #   define EOVERFLOW 132
64 #   define GNULIB_defined_EOVERFLOW 1
65 #  endif
66
67 #  ifndef ENOTSUP
68 #   define ENOTSUP   129
69 #   define GNULIB_defined_ENOTSUP 1
70 #  endif
71
72 #  ifndef ENETRESET
73 #   define ENETRESET 117
74 #   define GNULIB_defined_ENETRESET 1
75 #  endif
76
77 #  ifndef ECONNABORTED
78 #   define ECONNABORTED 106
79 #   define GNULIB_defined_ECONNABORTED 1
80 #  endif
81
82 #  ifndef ECANCELED
83 #   define ECANCELED 105
84 #   define GNULIB_defined_ECANCELED 1
85 #  endif
86
87 #  ifndef EOWNERDEAD
88 #   define EOWNERDEAD 133
89 #   define GNULIB_defined_EOWNERDEAD 1
90 #  endif
91
92 #  ifndef ENOTRECOVERABLE
93 #   define ENOTRECOVERABLE 127
94 #   define GNULIB_defined_ENOTRECOVERABLE 1
95 #  endif
96
97 #  ifndef EINPROGRESS
98 #   define EINPROGRESS     112
99 #   define EALREADY        103
100 #   define ENOTSOCK        128
101 #   define EDESTADDRREQ    109
102 #   define EMSGSIZE        115
103 #   define EPROTOTYPE      136
104 #   define ENOPROTOOPT     123
105 #   define EPROTONOSUPPORT 135
106 #   define EOPNOTSUPP      130
107 #   define EAFNOSUPPORT    102
108 #   define EADDRINUSE      100
109 #   define EADDRNOTAVAIL   101
110 #   define ENETDOWN        116
111 #   define ENETUNREACH     118
112 #   define ECONNRESET      108
113 #   define ENOBUFS         119
114 #   define EISCONN         113
115 #   define ENOTCONN        126
116 #   define ETIMEDOUT       138
117 #   define ECONNREFUSED    107
118 #   define ELOOP           114
119 #   define EHOSTUNREACH    110
120 #   define EWOULDBLOCK     140
121 #   define ETXTBSY         139
122 #   define ENODATA         120  /* not required by POSIX */
123 #   define ENOSR           124  /* not required by POSIX */
124 #   define ENOSTR          125  /* not required by POSIX */
125 #   define ETIME           137  /* not required by POSIX */
126 #   define EOTHER          131  /* not required by POSIX */
127 #   define GNULIB_defined_ESOCK 1
128 #  endif
129
130 /* These are intentionally the same values as the WSA* error numbers, defined
131    in <winsock2.h>.  */
132 #  define ESOCKTNOSUPPORT 10044  /* not required by POSIX */
133 #  define EPFNOSUPPORT    10046  /* not required by POSIX */
134 #  define ESHUTDOWN       10058  /* not required by POSIX */
135 #  define ETOOMANYREFS    10059  /* not required by POSIX */
136 #  define EHOSTDOWN       10064  /* not required by POSIX */
137 #  define EPROCLIM        10067  /* not required by POSIX */
138 #  define EUSERS          10068  /* not required by POSIX */
139 #  define EDQUOT          10069
140 #  define ESTALE          10070
141 #  define EREMOTE         10071  /* not required by POSIX */
142 #  define GNULIB_defined_EWINSOCK 1
143
144 # endif
145
146
147 /* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
148    EMULTIHOP, ENOLINK, EOVERFLOW are not defined.  */
149 # if @EMULTIHOP_HIDDEN@
150 #  define EMULTIHOP @EMULTIHOP_VALUE@
151 #  define GNULIB_defined_EMULTIHOP 1
152 # endif
153 # if @ENOLINK_HIDDEN@
154 #  define ENOLINK   @ENOLINK_VALUE@
155 #  define GNULIB_defined_ENOLINK 1
156 # endif
157 # if @EOVERFLOW_HIDDEN@
158 #  define EOVERFLOW @EOVERFLOW_VALUE@
159 #  define GNULIB_defined_EOVERFLOW 1
160 # endif
161
162
163 /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
164    EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
165    Likewise, on NonStop Kernel, EDQUOT is not defined.
166    Define them here.  Values >= 2000 seem safe to use: Solaris ESTALE = 151,
167    HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
168
169    Note: When one of these systems defines some of these macros some day,
170    binaries will have to be recompiled so that they recognizes the new
171    errno values from the system.  */
172
173 # ifndef ENOMSG
174 #  define ENOMSG    2000
175 #  define GNULIB_defined_ENOMSG 1
176 # endif
177
178 # ifndef EIDRM
179 #  define EIDRM     2001
180 #  define GNULIB_defined_EIDRM 1
181 # endif
182
183 # ifndef ENOLINK
184 #  define ENOLINK   2002
185 #  define GNULIB_defined_ENOLINK 1
186 # endif
187
188 # ifndef EPROTO
189 #  define EPROTO    2003
190 #  define GNULIB_defined_EPROTO 1
191 # endif
192
193 # ifndef EMULTIHOP
194 #  define EMULTIHOP 2004
195 #  define GNULIB_defined_EMULTIHOP 1
196 # endif
197
198 # ifndef EBADMSG
199 #  define EBADMSG   2005
200 #  define GNULIB_defined_EBADMSG 1
201 # endif
202
203 # ifndef EOVERFLOW
204 #  define EOVERFLOW 2006
205 #  define GNULIB_defined_EOVERFLOW 1
206 # endif
207
208 # ifndef ENOTSUP
209 #  define ENOTSUP   2007
210 #  define GNULIB_defined_ENOTSUP 1
211 # endif
212
213 # ifndef ENETRESET
214 #  define ENETRESET 2011
215 #  define GNULIB_defined_ENETRESET 1
216 # endif
217
218 # ifndef ECONNABORTED
219 #  define ECONNABORTED 2012
220 #  define GNULIB_defined_ECONNABORTED 1
221 # endif
222
223 # ifndef ESTALE
224 #  define ESTALE    2009
225 #  define GNULIB_defined_ESTALE 1
226 # endif
227
228 # ifndef EDQUOT
229 #  define EDQUOT 2010
230 #  define GNULIB_defined_EDQUOT 1
231 # endif
232
233 # ifndef ECANCELED
234 #  define ECANCELED 2008
235 #  define GNULIB_defined_ECANCELED 1
236 # endif
237
238 /* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
239    defined.  */
240
241 # ifndef EOWNERDEAD
242 #  if defined __sun
243     /* Use the same values as defined for Solaris >= 8, for
244        interoperability.  */
245 #   define EOWNERDEAD      58
246 #   define ENOTRECOVERABLE 59
247 #  elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
248     /* We have a conflict here: pthreads-win32 defines these values
249        differently than MSVC 10.  It's hairy to decide which one to use.  */
250 #   if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
251      /* Use the same values as defined by pthreads-win32, for
252         interoperability.  */
253 #    define EOWNERDEAD      43
254 #    define ENOTRECOVERABLE 44
255 #   else
256      /* Use the same values as defined by MSVC 10, for
257         interoperability.  */
258 #    define EOWNERDEAD      133
259 #    define ENOTRECOVERABLE 127
260 #   endif
261 #  else
262 #   define EOWNERDEAD      2013
263 #   define ENOTRECOVERABLE 2014
264 #  endif
265 #  define GNULIB_defined_EOWNERDEAD 1
266 #  define GNULIB_defined_ENOTRECOVERABLE 1
267 # endif
268
269 #endif /* _@GUARD_PREFIX@_ERRNO_H */
270 #endif /* _@GUARD_PREFIX@_ERRNO_H */