memcpy.c 527 B

1234567891011121314151617181920212223242526272829
  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. #include "_string.h"
  8. #ifdef WANT_WIDE
  9. # define Wmemcpy wmemcpy
  10. #else
  11. # undef memcpy
  12. # define Wmemcpy memcpy
  13. #endif
  14. Wvoid *Wmemcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)
  15. {
  16. register Wchar *r1 = s1;
  17. register const Wchar *r2 = s2;
  18. while (n) {
  19. *r1++ = *r2++;
  20. --n;
  21. }
  22. return s1;
  23. }
  24. libc_hidden_def(Wmemcpy)