ifunc-strstr.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* strstr variant information on S/390 version.
  2. Copyright (C) 2018-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. #if defined USE_MULTIARCH && IS_IN (libc) \
  16. && ! defined HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT
  17. # define HAVE_STRSTR_IFUNC 1
  18. #else
  19. # define HAVE_STRSTR_IFUNC 0
  20. #endif
  21. #ifdef HAVE_S390_VX_ASM_SUPPORT
  22. # define HAVE_STRSTR_IFUNC_AND_VX_SUPPORT HAVE_STRSTR_IFUNC
  23. #else
  24. # define HAVE_STRSTR_IFUNC_AND_VX_SUPPORT 0
  25. #endif
  26. #ifdef HAVE_S390_ARCH13_ASM_SUPPORT
  27. # define HAVE_STRSTR_IFUNC_AND_ARCH13_SUPPORT HAVE_STRSTR_IFUNC
  28. #else
  29. # define HAVE_STRSTR_IFUNC_AND_ARCH13_SUPPORT 0
  30. #endif
  31. #if defined HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT
  32. # define STRSTR_DEFAULT STRSTR_ARCH13
  33. # define HAVE_STRSTR_C 0
  34. # define HAVE_STRSTR_Z13 1
  35. # define STRSTR_Z13_ONLY_USED_AS_FALLBACK 1
  36. # define HAVE_STRSTR_ARCH13 1
  37. #elif defined HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT
  38. # define STRSTR_DEFAULT STRSTR_Z13
  39. # define HAVE_STRSTR_C 0
  40. # define HAVE_STRSTR_Z13 1
  41. # define HAVE_STRSTR_ARCH13 HAVE_STRSTR_IFUNC_AND_ARCH13_SUPPORT
  42. #else
  43. # define STRSTR_DEFAULT STRSTR_C
  44. # define HAVE_STRSTR_C 1
  45. # define HAVE_STRSTR_Z13 HAVE_STRSTR_IFUNC_AND_VX_SUPPORT
  46. # define HAVE_STRSTR_ARCH13 HAVE_STRSTR_IFUNC_AND_ARCH13_SUPPORT
  47. #endif
  48. #ifndef STRSTR_Z13_ONLY_USED_AS_FALLBACK
  49. # define STRSTR_Z13_ONLY_USED_AS_FALLBACK 0
  50. #endif
  51. #if HAVE_STRSTR_C
  52. # define STRSTR_C __strstr_c
  53. #else
  54. # define STRSTR_C NULL
  55. #endif
  56. #if HAVE_STRSTR_Z13
  57. # define STRSTR_Z13 __strstr_vx
  58. #else
  59. # define STRSTR_Z13 NULL
  60. #endif
  61. #if HAVE_STRSTR_ARCH13
  62. # define STRSTR_ARCH13 __strstr_arch13
  63. #else
  64. # define STRSTR_ARCH13 NULL
  65. #endif