]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/string/memcpy.c
Inital import
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / string / memcpy.c
1 /*
2  * Copyright (C) 2002     Manuel Novoa III
3  * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
4  *
5  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6  */
7
8 #include "_string.h"
9
10 #ifdef WANT_WIDE
11 # define Wmemcpy wmemcpy
12 #else
13 # undef memcpy
14 # define Wmemcpy memcpy
15 #endif
16
17 Wvoid *Wmemcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)
18 {
19         register Wchar *r1 = s1;
20         register const Wchar *r2 = s2;
21
22         while (n) {
23                 *r1++ = *r2++;
24                 --n;
25         }
26
27         return s1;
28 }
29 libc_hidden_def(Wmemcpy)