stpcpy.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Multiple versions of stpcpy.
  2. Copyright (C) 2015-2026 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #include <ifunc-stpcpy.h>
  16. #if HAVE_STPCPY_IFUNC
  17. # define stpcpy __redirect_stpcpy
  18. # define __stpcpy __redirect___stpcpy
  19. /* Omit the stpcpy inline definitions because it would redefine stpcpy. */
  20. # define __NO_STRING_INLINES
  21. # define NO_MEMPCPY_STPCPY_REDIRECT
  22. # include <string.h>
  23. # undef stpcpy
  24. # undef __stpcpy
  25. # include <ifunc-resolve.h>
  26. # if HAVE_STPCPY_C
  27. extern __typeof (__redirect_stpcpy) STPCPY_C attribute_hidden;
  28. # endif
  29. # if HAVE_STPCPY_Z13
  30. extern __typeof (__redirect_stpcpy) STPCPY_Z13 attribute_hidden;
  31. # endif
  32. s390_libc_ifunc_expr (__redirect___stpcpy, __stpcpy,
  33. (HAVE_STPCPY_Z13 && (hwcap & HWCAP_S390_VX))
  34. ? STPCPY_Z13
  35. : STPCPY_DEFAULT
  36. )
  37. weak_alias (__stpcpy, stpcpy)
  38. #endif