memcpy.c 659 B

12345678910111213141516171819202122232425262728293031323334353637
  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. # define Wmemcpy wmemcpy
  11. #else
  12. # define __Wmemcpy __memcpy
  13. # define Wmemcpy memcpy
  14. #endif
  15. Wvoid attribute_hidden *__Wmemcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)
  16. {
  17. register Wchar *r1 = s1;
  18. register const Wchar *r2 = s2;
  19. #ifdef __BCC__
  20. while (n--) {
  21. *r1++ = *r2++;
  22. }
  23. #else
  24. while (n) {
  25. *r1++ = *r2++;
  26. --n;
  27. }
  28. #endif
  29. return s1;
  30. }
  31. strong_alias(__Wmemcpy,Wmemcpy)