diff options
| author | Ron Yorston <rmy@pobox.com> | 2014-03-11 20:32:40 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2014-03-11 20:32:40 +0000 |
| commit | eab799e6ddcd41179c3ca2a7bbb48628da03b53c (patch) | |
| tree | 108a8d5c9b1cf02cda254936902d5c2987424e64 | |
| parent | dbd7151c0e7d991514372ebaf28d7c398acca184 (diff) | |
| download | busybox-w32-eab799e6ddcd41179c3ca2a7bbb48628da03b53c.tar.gz busybox-w32-eab799e6ddcd41179c3ca2a7bbb48628da03b53c.tar.bz2 busybox-w32-eab799e6ddcd41179c3ca2a7bbb48628da03b53c.zip | |
Import mempcpy from gnulib
| -rw-r--r-- | include/mingw.h | 5 | ||||
| -rw-r--r-- | win32/Kbuild | 1 | ||||
| -rw-r--r-- | win32/mempcpy.c | 26 |
3 files changed, 32 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h index ede7a72f5..c405c4a97 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
| @@ -174,6 +174,11 @@ void unsetenv(const char *env); | |||
| 174 | #define mktemp mingw_mktemp | 174 | #define mktemp mingw_mktemp |
| 175 | 175 | ||
| 176 | /* | 176 | /* |
| 177 | * string.h | ||
| 178 | */ | ||
| 179 | void *mempcpy(void *dest, const void *src, size_t n); | ||
| 180 | |||
| 181 | /* | ||
| 177 | * sys/ioctl.h | 182 | * sys/ioctl.h |
| 178 | */ | 183 | */ |
| 179 | 184 | ||
diff --git a/win32/Kbuild b/win32/Kbuild index c1005bd11..d82a9bfff 100644 --- a/win32/Kbuild +++ b/win32/Kbuild | |||
| @@ -14,6 +14,7 @@ lib-$(CONFIG_WIN32_NET) += net.o | |||
| 14 | lib-$(CONFIG_PLATFORM_MINGW32) += poll.o | 14 | lib-$(CONFIG_PLATFORM_MINGW32) += poll.o |
| 15 | lib-$(CONFIG_PLATFORM_MINGW32) += popen.o | 15 | lib-$(CONFIG_PLATFORM_MINGW32) += popen.o |
| 16 | lib-$(CONFIG_PLATFORM_MINGW32) += statfs.o | 16 | lib-$(CONFIG_PLATFORM_MINGW32) += statfs.o |
| 17 | lib-$(CONFIG_PLATFORM_MINGW32) += mempcpy.o | ||
| 17 | lib-$(CONFIG_PLATFORM_MINGW32) += mntent.o | 18 | lib-$(CONFIG_PLATFORM_MINGW32) += mntent.o |
| 18 | lib-$(CONFIG_PLATFORM_MINGW32) += strptime.o | 19 | lib-$(CONFIG_PLATFORM_MINGW32) += strptime.o |
| 19 | lib-$(CONFIG_PLATFORM_MINGW32) += system.o | 20 | lib-$(CONFIG_PLATFORM_MINGW32) += system.o |
diff --git a/win32/mempcpy.c b/win32/mempcpy.c new file mode 100644 index 000000000..81fc88f61 --- /dev/null +++ b/win32/mempcpy.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* Copy memory area and return pointer after last written byte. | ||
| 2 | Copyright (C) 2003, 2007, 2009-2014 Free Software Foundation, Inc. | ||
| 3 | |||
| 4 | This program is free software; you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation; either version 2, or (at your option) | ||
| 7 | any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ | ||
| 16 | |||
| 17 | /* Specification. */ | ||
| 18 | #include <string.h> | ||
| 19 | |||
| 20 | /* Copy N bytes of SRC to DEST, return pointer to bytes after the | ||
| 21 | last written byte. */ | ||
| 22 | void * | ||
| 23 | mempcpy (void *dest, const void *src, size_t n) | ||
| 24 | { | ||
| 25 | return (char *) memcpy (dest, src, n) + n; | ||
| 26 | } | ||
