2015-01-18 10:31 GMT+01:00 Matthias Andree <[email protected]>:
>
> That was the minor part because I can disable it by build configuration.
>
> What about mempcpy()?  That is a showstopper.

Please try the attached patch. I didn't try to compile it on a FreeBSD
system, but if it works for you we can ask Denys to merge it.

Bart
From 4eb37d61c378603571931088fd4820934bd24f5b Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <[email protected]>
Date: Mon, 19 Jan 2015 12:44:01 +0100
Subject: [PATCH] libbb: implement mempcpy for libc's without GNU extensions

Signed-off-by: Bartosz Golaszewski <[email protected]>
---
 include/libbb.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/libbb.h b/include/libbb.h
index be792d6..c5c47ac 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1398,6 +1398,13 @@ unsigned long long bb_makedev(unsigned major, unsigned minor) FAST_FUNC;
 #define makedev(a,b) bb_makedev(a,b)
 #endif
 
+#ifndef _GNU_SOURCE
+#undef mempcpy
+void ALWAYS_INLINE *mempcpy(void *dest, const void *src, size_t len)
+{
+	return memcpy(dest, src, len) + len;
+}
+#endif
 
 /* "Keycodes" that report an escape sequence.
  * We use something which fits into signed char,
-- 
2.1.4

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to