From df62c1c110e8532b995b23540b7e3695729c0779 Mon Sep 17 00:00:00 2001 From: Jing Yu Date: Thu, 5 Nov 2009 15:11:04 -0800 Subject: Check in gcc sources for prebuilt toolchains in Eclair. --- gcc-4.3.1/libiberty/strchr.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gcc-4.3.1/libiberty/strchr.c (limited to 'gcc-4.3.1/libiberty/strchr.c') diff --git a/gcc-4.3.1/libiberty/strchr.c b/gcc-4.3.1/libiberty/strchr.c new file mode 100644 index 000000000..935805ef4 --- /dev/null +++ b/gcc-4.3.1/libiberty/strchr.c @@ -0,0 +1,28 @@ +/* Portable version of strchr() + This function is in the public domain. */ + +/* + +@deftypefn Supplemental char* strchr (const char *@var{s}, int @var{c}) + +Returns a pointer to the first occurrence of the character @var{c} in +the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the +null character, the results are undefined. + +@end deftypefn + +*/ + +#include + +char * +strchr (register const char *s, int c) +{ + do { + if (*s == c) + { + return (char*)s; + } + } while (*s++); + return (0); +} -- cgit v1.2.3