diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-06-30 02:44:27 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-06-30 02:44:27 +0200 |
| commit | 0c4cf42c1e4fbb5af8952cfbec926fe7d7b318d5 (patch) | |
| tree | 9151f3494f4b2d4f192769dfa4c57ec031896494 /include | |
| parent | 0e79e7bb420c58fa8e5d2d88c5d3a26f94c761af (diff) | |
| download | busybox-w32-0c4cf42c1e4fbb5af8952cfbec926fe7d7b318d5.tar.gz busybox-w32-0c4cf42c1e4fbb5af8952cfbec926fe7d7b318d5.tar.bz2 busybox-w32-0c4cf42c1e4fbb5af8952cfbec926fe7d7b318d5.zip | |
libbb.h: tweak _unlocked hack
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/libbb.h | 54 |
1 files changed, 18 insertions, 36 deletions
diff --git a/include/libbb.h b/include/libbb.h index 963ae1e47..efb925eaf 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -160,42 +160,24 @@ int sysinfo(struct sysinfo* info); | |||
| 160 | #endif | 160 | #endif |
| 161 | 161 | ||
| 162 | 162 | ||
| 163 | /* Busybox does not use threads, we can speed up stdio. | 163 | /* Busybox does not use threads, we can speed up stdio. */ |
| 164 | * But don't define foo to foo_unlocked if foo_unlocked | 164 | #undef getc |
| 165 | * is a macro (it might be defined back to foo!). | 165 | #define getc(stream) getc_unlocked(stream) |
| 166 | */ | 166 | #undef getchar |
| 167 | #ifndef getc_unlocked | 167 | #define getchar() getchar_unlocked() |
| 168 | # undef getc | 168 | #undef putc |
| 169 | # define getc(stream) getc_unlocked(stream) | 169 | #define putc(c, stream) putc_unlocked(c, stream) |
| 170 | #endif | 170 | #undef putchar |
| 171 | #ifndef getchar_unlocked | 171 | #define putchar(c) putchar_unlocked(c) |
| 172 | # undef getchar | 172 | #undef fgetc |
| 173 | # define getchar() getchar_unlocked() | 173 | #define fgetc(stream) getc_unlocked(stream) |
| 174 | #endif | 174 | #undef fputc |
| 175 | #ifndef putc_unlocked | 175 | #define fputc(c, stream) putc_unlocked(c, stream) |
| 176 | # undef putc | 176 | /* Above functions are required by POSIX.1-2008, below ones are extensions */ |
| 177 | # define putc(c, stream) putc_unlocked(c, stream) | 177 | #undef fgets |
| 178 | #endif | 178 | #define fgets(s, n, stream) fgets_unlocked(s, n, stream) |
| 179 | #ifndef putchar_unlocked | 179 | #undef fputs |
| 180 | # undef putchar | 180 | #define fputs(s, stream) fputs_unlocked(s, stream) |
| 181 | # define putchar(c) putchar_unlocked(c) | ||
| 182 | #endif | ||
| 183 | #ifndef fgetc_unlocked | ||
| 184 | # undef fgetc | ||
| 185 | # define fgetc(stream) fgetc_unlocked(stream) | ||
| 186 | #endif | ||
| 187 | #ifndef fputc_unlocked | ||
| 188 | # undef fputc | ||
| 189 | # define fputc(c, stream) fputc_unlocked(c, stream) | ||
| 190 | #endif | ||
| 191 | #ifndef fgets_unlocked | ||
| 192 | # undef fgets | ||
| 193 | # define fgets(s, n, stream) fgets_unlocked(s, n, stream) | ||
| 194 | #endif | ||
| 195 | #ifndef fputs_unlocked | ||
| 196 | # undef fputs | ||
| 197 | # define fputs(s, stream) fputs_unlocked(s, stream) | ||
| 198 | #endif | ||
| 199 | 181 | ||
| 200 | 182 | ||
| 201 | /* Make all declarations hidden (-fvisibility flag only affects definitions) */ | 183 | /* Make all declarations hidden (-fvisibility flag only affects definitions) */ |
