diff options
-rw-r--r-- | include/libbb.h | 36 | ||||
-rw-r--r-- | include/platform.h | 10 |
2 files changed, 25 insertions, 21 deletions
diff --git a/include/libbb.h b/include/libbb.h index efb925eaf..1502272f6 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -161,23 +161,27 @@ int sysinfo(struct sysinfo* info); | |||
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 | #undef getc | 164 | #ifdef HAVE_UNLOCKED_STDIO |
165 | #define getc(stream) getc_unlocked(stream) | 165 | # undef getc |
166 | #undef getchar | 166 | # define getc(stream) getc_unlocked(stream) |
167 | #define getchar() getchar_unlocked() | 167 | # undef getchar |
168 | #undef putc | 168 | # define getchar() getchar_unlocked() |
169 | #define putc(c, stream) putc_unlocked(c, stream) | 169 | # undef putc |
170 | #undef putchar | 170 | # define putc(c, stream) putc_unlocked(c, stream) |
171 | #define putchar(c) putchar_unlocked(c) | 171 | # undef putchar |
172 | #undef fgetc | 172 | # define putchar(c) putchar_unlocked(c) |
173 | #define fgetc(stream) getc_unlocked(stream) | 173 | # undef fgetc |
174 | #undef fputc | 174 | # define fgetc(stream) getc_unlocked(stream) |
175 | #define fputc(c, stream) putc_unlocked(c, stream) | 175 | # undef fputc |
176 | # define fputc(c, stream) putc_unlocked(c, stream) | ||
177 | #endif | ||
176 | /* Above functions are required by POSIX.1-2008, below ones are extensions */ | 178 | /* Above functions are required by POSIX.1-2008, below ones are extensions */ |
177 | #undef fgets | 179 | #ifdef HAVE_UNLOCKED_LINE_OPS |
178 | #define fgets(s, n, stream) fgets_unlocked(s, n, stream) | 180 | # undef fgets |
179 | #undef fputs | 181 | # define fgets(s, n, stream) fgets_unlocked(s, n, stream) |
180 | #define fputs(s, stream) fputs_unlocked(s, stream) | 182 | # undef fputs |
183 | # define fputs(s, stream) fputs_unlocked(s, stream) | ||
184 | #endif | ||
181 | 185 | ||
182 | 186 | ||
183 | /* Make all declarations hidden (-fvisibility flag only affects definitions) */ | 187 | /* Make all declarations hidden (-fvisibility flag only affects definitions) */ |
diff --git a/include/platform.h b/include/platform.h index d186e4911..60864c929 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -350,16 +350,14 @@ typedef unsigned smalluint; | |||
350 | #define HAVE_STRSIGNAL 1 | 350 | #define HAVE_STRSIGNAL 1 |
351 | #define HAVE_STRVERSCMP 1 | 351 | #define HAVE_STRVERSCMP 1 |
352 | #define HAVE_VASPRINTF 1 | 352 | #define HAVE_VASPRINTF 1 |
353 | #define HAVE_UNLOCKED_STDIO 1 | ||
354 | #define HAVE_UNLOCKED_LINE_OPS 1 | ||
353 | #define HAVE_GETLINE 1 | 355 | #define HAVE_GETLINE 1 |
354 | #define HAVE_XTABS 1 | 356 | #define HAVE_XTABS 1 |
355 | #define HAVE_MNTENT_H 1 | 357 | #define HAVE_MNTENT_H 1 |
356 | #define HAVE_NET_ETHERNET_H 1 | 358 | #define HAVE_NET_ETHERNET_H 1 |
357 | #define HAVE_SYS_STATFS_H 1 | 359 | #define HAVE_SYS_STATFS_H 1 |
358 | 360 | ||
359 | #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 1) | ||
360 | # undef HAVE_NET_ETHERNET_H | ||
361 | #endif | ||
362 | |||
363 | #if defined(__UCLIBC_MAJOR__) | 361 | #if defined(__UCLIBC_MAJOR__) |
364 | # if __UCLIBC_MAJOR__ == 0 \ | 362 | # if __UCLIBC_MAJOR__ == 0 \ |
365 | && ( __UCLIBC_MINOR__ < 9 \ | 363 | && ( __UCLIBC_MINOR__ < 9 \ |
@@ -369,7 +367,6 @@ typedef unsigned smalluint; | |||
369 | # endif | 367 | # endif |
370 | #endif | 368 | #endif |
371 | 369 | ||
372 | |||
373 | #if defined(__dietlibc__) | 370 | #if defined(__dietlibc__) |
374 | # undef HAVE_STRCHRNUL | 371 | # undef HAVE_STRCHRNUL |
375 | #endif | 372 | #endif |
@@ -387,6 +384,8 @@ typedef unsigned smalluint; | |||
387 | # undef HAVE_STRSIGNAL | 384 | # undef HAVE_STRSIGNAL |
388 | # undef HAVE_STRVERSCMP | 385 | # undef HAVE_STRVERSCMP |
389 | # undef HAVE_VASPRINTF | 386 | # undef HAVE_VASPRINTF |
387 | # undef HAVE_UNLOCKED_STDIO | ||
388 | # undef HAVE_UNLOCKED_LINE_OPS | ||
390 | # undef HAVE_NET_ETHERNET_H | 389 | # undef HAVE_NET_ETHERNET_H |
391 | #endif | 390 | #endif |
392 | 391 | ||
@@ -424,6 +423,7 @@ typedef unsigned smalluint; | |||
424 | # undef HAVE_STPCPY | 423 | # undef HAVE_STPCPY |
425 | # undef HAVE_STRCHRNUL | 424 | # undef HAVE_STRCHRNUL |
426 | # undef HAVE_STRVERSCMP | 425 | # undef HAVE_STRVERSCMP |
426 | # undef HAVE_UNLOCKED_LINE_OPS | ||
427 | # undef HAVE_NET_ETHERNET_H | 427 | # undef HAVE_NET_ETHERNET_H |
428 | #endif | 428 | #endif |
429 | 429 | ||