aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h25
-rw-r--r--include/platform.h5
2 files changed, 29 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 63e99cfe2..3b2d23df8 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -204,6 +204,29 @@ int klogctl(int type, char *b, int len);
204# define MINGW_SPECIAL(a) a 204# define MINGW_SPECIAL(a) a
205#endif 205#endif
206 206
207#if __GNUC_PREREQ(5,0)
208/* Since musl is apparently unable to get it right and would use
209 * a function call to a single-instruction function of "bswap %eax",
210 * reroute to gcc builtins:
211 */
212# undef bswap_16
213# undef bswap_32
214# undef bswap_64
215# define bswap_16(x) __builtin_bswap16(x)
216# define bswap_32(x) __builtin_bswap32(x)
217# define bswap_64(x) __builtin_bswap64(x)
218# if BB_LITTLE_ENDIAN
219# undef ntohs
220# undef htons
221# undef ntohl
222# undef htonl
223# define ntohs(x) __builtin_bswap16(x)
224# define htons(x) __builtin_bswap16(x)
225# define ntohl(x) __builtin_bswap32(x)
226# define htonl(x) __builtin_bswap32(x)
227# endif
228#endif
229
207/* Busybox does not use threads, we can speed up stdio. */ 230/* Busybox does not use threads, we can speed up stdio. */
208#ifdef HAVE_UNLOCKED_STDIO 231#ifdef HAVE_UNLOCKED_STDIO
209# undef getc 232# undef getc
@@ -662,7 +685,7 @@ uoff_t FAST_FUNC get_volume_size_in_bytes(int fd,
662 unsigned override_units, 685 unsigned override_units,
663 int extend); 686 int extend);
664 687
665void xpipe(int filedes[2]) FAST_FUNC; 688void xpipe(int *filedes) FAST_FUNC;
666/* In this form code with pipes is much more readable */ 689/* In this form code with pipes is much more readable */
667struct fd_pair { int rd; int wr; }; 690struct fd_pair { int rd; int wr; };
668#define piped_pair(pair) pipe(&((pair).rd)) 691#define piped_pair(pair) pipe(&((pair).rd))
diff --git a/include/platform.h b/include/platform.h
index d992b2633..b2d918643 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -216,6 +216,7 @@
216#endif 216#endif
217 217
218#if ULONG_MAX > 0xffffffff 218#if ULONG_MAX > 0xffffffff
219/* inline 64-bit bswap only on 64-bit arches */
219# define bb_bswap_64(x) bswap_64(x) 220# define bb_bswap_64(x) bswap_64(x)
220#endif 221#endif
221 222
@@ -445,6 +446,7 @@ typedef unsigned smalluint;
445#define HAVE_NET_ETHERNET_H 1 446#define HAVE_NET_ETHERNET_H 1
446#define HAVE_SYS_STATFS_H 1 447#define HAVE_SYS_STATFS_H 1
447#define HAVE_PRINTF_PERCENTM 1 448#define HAVE_PRINTF_PERCENTM 1
449#define HAVE_WAIT3 1
448 450
449#if defined(__UCLIBC__) 451#if defined(__UCLIBC__)
450# if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32) 452# if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32)
@@ -578,6 +580,9 @@ typedef unsigned smalluint;
578# undef HAVE_STPCPY 580# undef HAVE_STPCPY
579# undef HAVE_STPNCPY 581# undef HAVE_STPNCPY
580# endif 582# endif
583# if __ANDROID_API__ >= 21
584# undef HAVE_WAIT3
585# endif
581# undef HAVE_MEMPCPY 586# undef HAVE_MEMPCPY
582# undef HAVE_STRCHRNUL 587# undef HAVE_STRCHRNUL
583# undef HAVE_STRVERSCMP 588# undef HAVE_STRVERSCMP