summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f6ea3a0)
Adjust for portability:
[HAVE_STDLIB_H]: Include stdlib.h.
[HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
Undef __memchr, too.
[!weak_alias]: Define __memchr to memchr.
-/* Copyright (C) 1991, 1993, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991,93,96,97,99,2000 Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
with help from Dan Sahlin (dan@sics.se) and
commentary by Jim Blandy (jimb@ai.mit.edu);
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
with help from Dan Sahlin (dan@sics.se) and
commentary by Jim Blandy (jimb@ai.mit.edu);
# define __ptr_t char *
#endif /* C++ or ANSI C. */
# define __ptr_t char *
#endif /* C++ or ANSI C. */
+# include <memcopy.h>
+#else
+# define reg_char char
+#endif
+
+#if HAVE_STDLIB_H || defined _LIBC
+# include <stdlib.h>
-#if defined (HAVE_LIMITS_H) || defined (_LIBC)
+#if HAVE_LIMITS_H || defined _LIBC
# include <limits.h>
#endif
# include <limits.h>
#endif
#endif
#include <sys/types.h>
#endif
#include <sys/types.h>
+#if HAVE_BP_SYM_H || defined _LIBC
+# include <bp-sym.h>
+#else
+# define BP_SYM(sym) sym
+#endif
+#undef memchr
+#undef __memchr
/* Search no more than N bytes of S for C. */
/* Search no more than N bytes of S for C. */
size_t n;
{
const unsigned char *char_ptr;
const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, charmask;
size_t n;
{
const unsigned char *char_ptr;
const unsigned long int *longword_ptr;
unsigned long int longword, magic_bits, charmask;
+ c = (unsigned char) c_in;
/* Handle the first few characters by reading one character at a time.
Do this until CHAR_PTR is aligned on a longword boundary. */
/* Handle the first few characters by reading one character at a time.
Do this until CHAR_PTR is aligned on a longword boundary. */
+#ifdef weak_alias
+weak_alias (__memchr, BP_SYM (memchr))
+#endif