aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-05-14 08:17:12 +0100
committerRon Yorston <rmy@pobox.com>2021-05-14 08:17:12 +0100
commita3f5a1b7f4275f713acf22f534f95c0da8392e53 (patch)
tree49b65422a3e9c33f508da9ccf3ae79d324bd9e96 /include/libbb.h
parent375cda9a88024135d630ca8990d9aff4ea414e89 (diff)
parent7de0ab21d939a5a304157f75918d0318a95261a3 (diff)
downloadbusybox-w32-a3f5a1b7f4275f713acf22f534f95c0da8392e53.tar.gz
busybox-w32-a3f5a1b7f4275f713acf22f534f95c0da8392e53.tar.bz2
busybox-w32-a3f5a1b7f4275f713acf22f534f95c0da8392e53.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h25
1 files changed, 24 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))