diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-06-20 14:13:21 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-06-20 14:13:21 -0300 |
| commit | 52062684e11beffafbbbff0a8c7aa2642e40e47e (patch) | |
| tree | 454857ad4800f768e16f8d592f71275d9541df80 | |
| parent | 83e3ec0117c9b8da4ec4f2e5451044b843e2fd3c (diff) | |
| download | lua-52062684e11beffafbbbff0a8c7aa2642e40e47e.tar.gz lua-52062684e11beffafbbbff0a8c7aa2642e40e47e.tar.bz2 lua-52062684e11beffafbbbff0a8c7aa2642e40e47e.zip | |
better control over use of `errno'
| -rw-r--r-- | liolib.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,12 +1,11 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 1.66 2000/05/30 18:55:16 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 1.67 2000/06/12 13:52:05 roberto Exp roberto $ |
| 3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | #include <ctype.h> | 8 | #include <ctype.h> |
| 9 | #include <errno.h> | ||
| 10 | #include <stdio.h> | 9 | #include <stdio.h> |
| 11 | #include <stdlib.h> | 10 | #include <stdlib.h> |
| 12 | #include <string.h> | 11 | #include <string.h> |
| @@ -22,6 +21,7 @@ | |||
| 22 | 21 | ||
| 23 | 22 | ||
| 24 | #ifndef OLD_ANSI | 23 | #ifndef OLD_ANSI |
| 24 | #include <errno.h> | ||
| 25 | #include <locale.h> | 25 | #include <locale.h> |
| 26 | #else | 26 | #else |
| 27 | /* no support for locale and for strerror: fake them */ | 27 | /* no support for locale and for strerror: fake them */ |
| @@ -32,7 +32,8 @@ | |||
| 32 | #define LC_MONETARY 0 | 32 | #define LC_MONETARY 0 |
| 33 | #define LC_NUMERIC 0 | 33 | #define LC_NUMERIC 0 |
| 34 | #define LC_TIME 0 | 34 | #define LC_TIME 0 |
| 35 | #define strerror(e) "(no error message provided by operating system)" | 35 | #define strerror(e) "generic I/O error" |
| 36 | #define errno (-1) | ||
| 36 | #endif | 37 | #endif |
| 37 | 38 | ||
| 38 | 39 | ||
