mempcpy.c 561 B

123456789101112131415161718192021222324252627282930313233
  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 __USE_GNU
  9. #ifdef WANT_WIDE
  10. # define Wmempcpy wmempcpy
  11. #else
  12. # undef mempcpy
  13. # define Wmempcpy mempcpy
  14. #endif
  15. Wvoid *Wmempcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)
  16. {
  17. register Wchar *r1 = s1;
  18. register const Wchar *r2 = s2;
  19. while (n) {
  20. *r1++ = *r2++;
  21. --n;
  22. }
  23. return r1;
  24. }
  25. libc_hidden_weak(Wmempcpy)
  26. #endif