diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2013-01-10 20:25:44 +0000 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2013-01-10 20:25:44 +0000 |
commit | 3e4eb4437ef93ff664b47c3dca954185e2ada34a (patch) | |
tree | 6a5f2424b28e7db62292e335a9f2eb5b354f2d28 /src/lib/evil | |
parent | 23b741699f041638bada8b6f2b06ec1019b1811e (diff) |
efl: remove check for errno.h
SVN revision: 82581
Diffstat (limited to 'src/lib/evil')
-rw-r--r-- | src/lib/evil/evil_dirent.c | 23 | ||||
-rw-r--r-- | src/lib/evil/evil_inet.c | 5 | ||||
-rw-r--r-- | src/lib/evil/evil_link_xp.cpp | 2 | ||||
-rw-r--r-- | src/lib/evil/evil_printa.c | 22 | ||||
-rw-r--r-- | src/lib/evil/evil_stdlib.c | 14 | ||||
-rw-r--r-- | src/lib/evil/evil_unistd.c | 2 |
6 files changed, 5 insertions, 63 deletions
diff --git a/src/lib/evil/evil_dirent.c b/src/lib/evil/evil_dirent.c index e02b95fe27..041899d53e 100644 --- a/src/lib/evil/evil_dirent.c +++ b/src/lib/evil/evil_dirent.c | |||
@@ -3,10 +3,7 @@ | |||
3 | #endif /* HAVE_CONFIG_H */ | 3 | #endif /* HAVE_CONFIG_H */ |
4 | 4 | ||
5 | #include <dirent.h> | 5 | #include <dirent.h> |
6 | 6 | #include <errno.h> | |
7 | #ifdef HAVE_ERRNO_H | ||
8 | # include <errno.h> | ||
9 | #endif | ||
10 | 7 | ||
11 | #include "Evil.h" | 8 | #include "Evil.h" |
12 | 9 | ||
@@ -34,9 +31,7 @@ DIR *opendir(char const *name) | |||
34 | /* valid name */ | 31 | /* valid name */ |
35 | if (!name || !*name) | 32 | if (!name || !*name) |
36 | { | 33 | { |
37 | #ifdef HAVE_ERRNO_H | ||
38 | errno = ENOENT; | 34 | errno = ENOENT; |
39 | #endif | ||
40 | return NULL; | 35 | return NULL; |
41 | } | 36 | } |
42 | 37 | ||
@@ -44,9 +39,7 @@ DIR *opendir(char const *name) | |||
44 | wname = evil_char_to_wchar(name); | 39 | wname = evil_char_to_wchar(name); |
45 | if (!wname) | 40 | if (!wname) |
46 | { | 41 | { |
47 | # ifdef HAVE_ERRNO_H | ||
48 | errno = ENOMEM; | 42 | errno = ENOMEM; |
49 | # endif | ||
50 | return NULL; | 43 | return NULL; |
51 | } | 44 | } |
52 | 45 | ||
@@ -55,9 +48,7 @@ DIR *opendir(char const *name) | |||
55 | if((attr = GetFileAttributes(name)) == 0xFFFFFFFF) | 48 | if((attr = GetFileAttributes(name)) == 0xFFFFFFFF) |
56 | #endif | 49 | #endif |
57 | { | 50 | { |
58 | #ifdef HAVE_ERRNO_H | ||
59 | errno = ENOENT; | 51 | errno = ENOENT; |
60 | #endif | ||
61 | return NULL; | 52 | return NULL; |
62 | } | 53 | } |
63 | 54 | ||
@@ -68,18 +59,14 @@ DIR *opendir(char const *name) | |||
68 | /* directory */ | 59 | /* directory */ |
69 | if (!(attr & FILE_ATTRIBUTE_DIRECTORY)) | 60 | if (!(attr & FILE_ATTRIBUTE_DIRECTORY)) |
70 | { | 61 | { |
71 | #ifdef HAVE_ERRNO_H | ||
72 | errno = ENOTDIR; | 62 | errno = ENOTDIR; |
73 | #endif | ||
74 | return NULL; | 63 | return NULL; |
75 | } | 64 | } |
76 | 65 | ||
77 | dir = (DIR *)malloc(sizeof(DIR)); | 66 | dir = (DIR *)malloc(sizeof(DIR)); |
78 | if (!dir) | 67 | if (!dir) |
79 | { | 68 | { |
80 | #ifdef HAVE_ERRNO_H | ||
81 | errno = ENOMEM; | 69 | errno = ENOMEM; |
82 | #endif | ||
83 | return NULL; | 70 | return NULL; |
84 | } | 71 | } |
85 | 72 | ||
@@ -87,9 +74,7 @@ DIR *opendir(char const *name) | |||
87 | tmp1 = (char *)malloc(sizeof(char) * l + 5); | 74 | tmp1 = (char *)malloc(sizeof(char) * l + 5); |
88 | if (!tmp1) | 75 | if (!tmp1) |
89 | { | 76 | { |
90 | #ifdef HAVE_ERRNO_H | ||
91 | errno = ENOMEM; | 77 | errno = ENOMEM; |
92 | #endif | ||
93 | return NULL; | 78 | return NULL; |
94 | } | 79 | } |
95 | 80 | ||
@@ -107,9 +92,7 @@ DIR *opendir(char const *name) | |||
107 | wname = evil_char_to_wchar(tmp1); | 92 | wname = evil_char_to_wchar(tmp1); |
108 | if (!wname) | 93 | if (!wname) |
109 | { | 94 | { |
110 | #ifdef HAVE_ERRNO_H | ||
111 | errno = ENOMEM; | 95 | errno = ENOMEM; |
112 | #endif | ||
113 | free(tmp1); | 96 | free(tmp1); |
114 | 97 | ||
115 | return NULL; | 98 | return NULL; |
@@ -149,9 +132,7 @@ int closedir(DIR *dir) | |||
149 | { | 132 | { |
150 | if (!dir) | 133 | if (!dir) |
151 | { | 134 | { |
152 | #ifdef HAVE_ERRNO_H | ||
153 | errno = EBADF; | 135 | errno = EBADF; |
154 | #endif | ||
155 | return -1; | 136 | return -1; |
156 | } | 137 | } |
157 | 138 | ||
@@ -170,9 +151,7 @@ struct dirent *readdir(DIR *dir) | |||
170 | 151 | ||
171 | if (!dir) | 152 | if (!dir) |
172 | { | 153 | { |
173 | #ifdef HAVE_ERRNO_H | ||
174 | errno = EBADF; | 154 | errno = EBADF; |
175 | #endif | ||
176 | return NULL; | 155 | return NULL; |
177 | } | 156 | } |
178 | 157 | ||
diff --git a/src/lib/evil/evil_inet.c b/src/lib/evil/evil_inet.c index 99ce14edc2..c4938334af 100644 --- a/src/lib/evil/evil_inet.c +++ b/src/lib/evil/evil_inet.c | |||
@@ -26,13 +26,10 @@ | |||
26 | # include "config.h" | 26 | # include "config.h" |
27 | #endif /* HAVE_CONFIG_H */ | 27 | #endif /* HAVE_CONFIG_H */ |
28 | 28 | ||
29 | #include <errno.h> | ||
29 | #include <stdio.h> | 30 | #include <stdio.h> |
30 | #include <ctype.h> | 31 | #include <ctype.h> |
31 | 32 | ||
32 | #ifdef HAVE_ERRNO_H | ||
33 | # include <errno.h> | ||
34 | #endif /* HAVE_ERRNO_H */ | ||
35 | |||
36 | #ifndef WIN32_LEAN_AND_MEAN | 33 | #ifndef WIN32_LEAN_AND_MEAN |
37 | # define WIN32_LEAN_AND_MEAN | 34 | # define WIN32_LEAN_AND_MEAN |
38 | #endif | 35 | #endif |
diff --git a/src/lib/evil/evil_link_xp.cpp b/src/lib/evil/evil_link_xp.cpp index 675908f75b..2b5b956b4a 100644 --- a/src/lib/evil/evil_link_xp.cpp +++ b/src/lib/evil/evil_link_xp.cpp | |||
@@ -2,9 +2,7 @@ | |||
2 | # include "config.h" | 2 | # include "config.h" |
3 | #endif /* HAVE_CONFIG_H */ | 3 | #endif /* HAVE_CONFIG_H */ |
4 | 4 | ||
5 | #ifdef HAVE_ERRNO_H | ||
6 | #include <errno.h> | 5 | #include <errno.h> |
7 | #endif /* HAVE_ERRNO_H */ | ||
8 | 6 | ||
9 | #include <shlobj.h> | 7 | #include <shlobj.h> |
10 | #include <objidl.h> | 8 | #include <objidl.h> |
diff --git a/src/lib/evil/evil_printa.c b/src/lib/evil/evil_printa.c index e6f6eb8227..a0f8593916 100644 --- a/src/lib/evil/evil_printa.c +++ b/src/lib/evil/evil_printa.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #define __CRT__NO_INLINE | 1 | #define __CRT__NO_INLINE |
2 | 2 | ||
3 | #include <errno.h> | ||
3 | #include <limits.h> | 4 | #include <limits.h> |
4 | #include <stddef.h> | 5 | #include <stddef.h> |
5 | #include <stdarg.h> | 6 | #include <stdarg.h> |
@@ -12,10 +13,6 @@ | |||
12 | #include <wctype.h> | 13 | #include <wctype.h> |
13 | #include <locale.h> | 14 | #include <locale.h> |
14 | 15 | ||
15 | #ifdef HAVE_ERRNO_H | ||
16 | # include <errno.h> | ||
17 | #endif /* HAVE_ERRNO_H */ | ||
18 | |||
19 | #include "evil_pformat.h" | 16 | #include "evil_pformat.h" |
20 | #include "evil_print.h" | 17 | #include "evil_print.h" |
21 | #include "gdtoa/gdtoa.h" | 18 | #include "gdtoa/gdtoa.h" |
@@ -300,9 +297,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) | |||
300 | 297 | ||
301 | if (!s || s->fp == NULL || !format) | 298 | if (!s || s->fp == NULL || !format) |
302 | { | 299 | { |
303 | #ifdef HAVE_ERRNO_H | ||
304 | errno = EINVAL; | 300 | errno = EINVAL; |
305 | #endif /* HAVE_ERRNO_H */ | ||
306 | return EOF; | 301 | return EOF; |
307 | } | 302 | } |
308 | 303 | ||
@@ -485,10 +480,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) | |||
485 | do | 480 | do |
486 | { | 481 | { |
487 | if ((c == EOF || (c = in_ch (s, &read_in)) == EOF) | 482 | if ((c == EOF || (c = in_ch (s, &read_in)) == EOF) |
488 | #ifdef HAVE_ERRNO_H | 483 | && errno == EINTR) |
489 | && errno == EINTR | ||
490 | #endif /* HAVE_ERRNO_H */ | ||
491 | ) | ||
492 | return cleanup_return ((!rval ? EOF : rval), &gcollect, pstr, &wbuf); | 484 | return cleanup_return ((!rval ? EOF : rval), &gcollect, pstr, &wbuf); |
493 | } | 485 | } |
494 | while (isspace (c)); | 486 | while (isspace (c)); |
@@ -678,9 +670,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) | |||
678 | { | 670 | { |
679 | if ((c = in_ch (s, &read_in)) == EOF) | 671 | if ((c = in_ch (s, &read_in)) == EOF) |
680 | { | 672 | { |
681 | #ifdef HAVE_ERRNO_H | ||
682 | errno = EILSEQ; | 673 | errno = EILSEQ; |
683 | #endif /* HAVE_ERRNO_H */ | ||
684 | return cleanup_return (rval, &gcollect, pstr, &wbuf); | 674 | return cleanup_return (rval, &gcollect, pstr, &wbuf); |
685 | } | 675 | } |
686 | 676 | ||
@@ -690,9 +680,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) | |||
690 | 680 | ||
691 | if (n != 1) | 681 | if (n != 1) |
692 | { | 682 | { |
693 | #ifdef HAVE_ERRNO_H | ||
694 | errno = EILSEQ; | 683 | errno = EILSEQ; |
695 | #endif /* HAVE_ERRNO_H */ | ||
696 | return cleanup_return (rval, &gcollect, pstr, &wbuf); | 684 | return cleanup_return (rval, &gcollect, pstr, &wbuf); |
697 | } | 685 | } |
698 | break; | 686 | break; |
@@ -842,9 +830,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) | |||
842 | { | 830 | { |
843 | if ((c = in_ch (s, &read_in)) == EOF) | 831 | if ((c = in_ch (s, &read_in)) == EOF) |
844 | { | 832 | { |
845 | #ifdef HAVE_ERRNO_H | ||
846 | errno = EILSEQ; | 833 | errno = EILSEQ; |
847 | #endif /* HAVE_ERRNO_H */ | ||
848 | return cleanup_return (rval, &gcollect, pstr, &wbuf); | 834 | return cleanup_return (rval, &gcollect, pstr, &wbuf); |
849 | } | 835 | } |
850 | 836 | ||
@@ -854,9 +840,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) | |||
854 | 840 | ||
855 | if (n != 1) | 841 | if (n != 1) |
856 | { | 842 | { |
857 | #ifdef HAVE_ERRNO_H | ||
858 | errno = EILSEQ; | 843 | errno = EILSEQ; |
859 | #endif /* HAVE_ERRNO_H */ | ||
860 | return cleanup_return (rval, &gcollect, pstr, &wbuf); | 844 | return cleanup_return (rval, &gcollect, pstr, &wbuf); |
861 | } | 845 | } |
862 | 846 | ||
@@ -1485,9 +1469,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) | |||
1485 | 1469 | ||
1486 | if (cnt != 0) | 1470 | if (cnt != 0) |
1487 | { | 1471 | { |
1488 | #ifdef HAVE_ERRNO_H | ||
1489 | errno = EILSEQ; | 1472 | errno = EILSEQ; |
1490 | #endif /* HAVE_ERRNO_H */ | ||
1491 | return cleanup_return (rval, &gcollect, pstr, &wbuf); | 1473 | return cleanup_return (rval, &gcollect, pstr, &wbuf); |
1492 | } | 1474 | } |
1493 | 1475 | ||
diff --git a/src/lib/evil/evil_stdlib.c b/src/lib/evil/evil_stdlib.c index d22a7dc71e..ffd9acde9a 100644 --- a/src/lib/evil/evil_stdlib.c +++ b/src/lib/evil/evil_stdlib.c | |||
@@ -8,9 +8,7 @@ | |||
8 | #include <fcntl.h> | 8 | #include <fcntl.h> |
9 | #include <sys/stat.h> | 9 | #include <sys/stat.h> |
10 | 10 | ||
11 | #ifdef HAVE_ERRNO_H | 11 | #include <errno.h> |
12 | # include <errno.h> | ||
13 | #endif /* HAVE_ERRNO_H */ | ||
14 | 12 | ||
15 | #ifndef WIN32_LEAN_AND_MEAN | 13 | #ifndef WIN32_LEAN_AND_MEAN |
16 | # define WIN32_LEAN_AND_MEAN | 14 | # define WIN32_LEAN_AND_MEAN |
@@ -147,9 +145,7 @@ setenv(const char *name, | |||
147 | /* if '=' is found, return EINVAL */ | 145 | /* if '=' is found, return EINVAL */ |
148 | if (strchr (name, '=')) | 146 | if (strchr (name, '=')) |
149 | { | 147 | { |
150 | #ifdef HAVE_ERRNO_H | ||
151 | errno = EINVAL; | 148 | errno = EINVAL; |
152 | #endif /* HAVE_ERRNO_H */ | ||
153 | return -1; | 149 | return -1; |
154 | } | 150 | } |
155 | 151 | ||
@@ -163,9 +159,7 @@ setenv(const char *name, | |||
163 | str = (char *)malloc(length); | 159 | str = (char *)malloc(length); |
164 | if (!str) | 160 | if (!str) |
165 | { | 161 | { |
166 | #ifdef HAVE_ERRNO_H | ||
167 | errno = ENOMEM; | 162 | errno = ENOMEM; |
168 | #endif /* HAVE_ERRNO_H */ | ||
169 | return -1; | 163 | return -1; |
170 | } | 164 | } |
171 | if (!value) | 165 | if (!value) |
@@ -292,9 +286,7 @@ mkstemp(char *__template) | |||
292 | if ((length < 6) || | 286 | if ((length < 6) || |
293 | (strncmp (__template + length - 6, "XXXXXX", 6))) | 287 | (strncmp (__template + length - 6, "XXXXXX", 6))) |
294 | { | 288 | { |
295 | #ifdef HAVE_ERRNO_H | ||
296 | errno = EINVAL; | 289 | errno = EINVAL; |
297 | #endif /* HAVE_ERRNO_H */ | ||
298 | return -1; | 290 | return -1; |
299 | } | 291 | } |
300 | 292 | ||
@@ -337,9 +329,7 @@ mkstemp(char *__template) | |||
337 | free(wtemplate); | 329 | free(wtemplate); |
338 | if (!f) | 330 | if (!f) |
339 | { | 331 | { |
340 | # ifdef HAVE_ERRNO_H | ||
341 | errno = EEXIST; | 332 | errno = EEXIST; |
342 | # endif /* HAVE_ERRNO_H */ | ||
343 | return -1; | 333 | return -1; |
344 | } | 334 | } |
345 | fd = (int)_fileno(f); | 335 | fd = (int)_fileno(f); |
@@ -351,9 +341,7 @@ mkstemp(char *__template) | |||
351 | val += 7777; | 341 | val += 7777; |
352 | } | 342 | } |
353 | 343 | ||
354 | #ifdef HAVE_ERRNO_H | ||
355 | errno = EEXIST; | 344 | errno = EEXIST; |
356 | #endif /* HAVE_ERRNO_H */ | ||
357 | return -1; | 345 | return -1; |
358 | } | 346 | } |
359 | 347 | ||
diff --git a/src/lib/evil/evil_unistd.c b/src/lib/evil/evil_unistd.c index 10ef018e1e..cfa5320aba 100644 --- a/src/lib/evil/evil_unistd.c +++ b/src/lib/evil/evil_unistd.c | |||
@@ -2,9 +2,7 @@ | |||
2 | # include "config.h" | 2 | # include "config.h" |
3 | #endif /* HAVE_CONFIG_H */ | 3 | #endif /* HAVE_CONFIG_H */ |
4 | 4 | ||
5 | #ifdef HAVE_ERRNO_H | ||
6 | #include <errno.h> | 5 | #include <errno.h> |
7 | #endif /* HAVE_ERRNO_H */ | ||
8 | 6 | ||
9 | #ifndef WIN32_LEAN_AND_MEAN | 7 | #ifndef WIN32_LEAN_AND_MEAN |
10 | # define WIN32_LEAN_AND_MEAN | 8 | # define WIN32_LEAN_AND_MEAN |