hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame sysdeps/s390/memmem.c

Packit a5344b
/* Multiple versions of memmem.
Packit a5344b
   Copyright (C) 2018 Free Software Foundation, Inc.
Packit a5344b
   This file is part of the GNU C Library.
Packit a5344b
Packit a5344b
   The GNU C Library is free software; you can redistribute it and/or
Packit a5344b
   modify it under the terms of the GNU Lesser General Public
Packit a5344b
   License as published by the Free Software Foundation; either
Packit a5344b
   version 2.1 of the License, or (at your option) any later version.
Packit a5344b
Packit a5344b
   The GNU C Library is distributed in the hope that it will be useful,
Packit a5344b
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a5344b
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a5344b
   Lesser General Public License for more details.
Packit a5344b
Packit a5344b
   You should have received a copy of the GNU Lesser General Public
Packit a5344b
   License along with the GNU C Library; if not, see
Packit a5344b
   <http://www.gnu.org/licenses/>.  */
Packit a5344b
Packit a5344b
#include <ifunc-memmem.h>
Packit a5344b
Packit a5344b
#if HAVE_MEMMEM_IFUNC
Packit a5344b
# define memmem __redirect_memmem
Packit a5344b
# define __memmem __redirect___memmem
Packit a5344b
# include <string.h>
Packit a5344b
# include <ifunc-resolve.h>
Packit a5344b
# undef memmem
Packit a5344b
# undef __memmem
Packit a5344b
Packit a5344b
# if HAVE_MEMMEM_C
Packit a5344b
extern __typeof (__redirect_memmem) MEMMEM_C attribute_hidden;
Packit a5344b
# endif
Packit a5344b
Packit a5344b
# if HAVE_MEMMEM_Z13
Packit a5344b
extern __typeof (__redirect_memmem) MEMMEM_Z13 attribute_hidden;
Packit a5344b
# endif
Packit a5344b
Packit 61b137
# if HAVE_MEMMEM_ARCH13
Packit 61b137
extern __typeof (__redirect_memmem) MEMMEM_ARCH13 attribute_hidden;
Packit 61b137
# endif
Packit 61b137
Packit a5344b
s390_libc_ifunc_expr (__redirect_memmem, __memmem,
Packit 61b137
		      (HAVE_MEMMEM_ARCH13 && (hwcap & HWCAP_S390_VXRS_EXT2))
Packit 61b137
		      ? MEMMEM_ARCH13
Packit 61b137
		      : (HAVE_MEMMEM_Z13 && (hwcap & HWCAP_S390_VX))
Packit a5344b
		      ? MEMMEM_Z13
Packit a5344b
		      : MEMMEM_DEFAULT
Packit a5344b
		      )
Packit a5344b
weak_alias (__memmem, memmem)
Packit a5344b
#endif