libc: Integrate strrchr in libc
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Thu, 18 Oct 2018 23:57:10 +0000 (00:57 +0100)
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Tue, 23 Oct 2018 17:27:45 +0000 (18:27 +0100)
Change-Id: I3ddc07cb02d73cd7614af7a5b21827aae155f9a0
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
include/lib/libc/string.h
lib/libc/libc.mk
lib/libc/strrchr.c

index 050f6438095c9074dbd5fe7cc8368513e009d5f9..3c8e3b65e2d0aed4812650dd006e7d2d11e50bec 100644 (file)
@@ -27,5 +27,6 @@ char *strchr(const char *s, int c);
 void *memset(void *dst, int val, size_t count);
 size_t strlen(const char *s);
 size_t strnlen(const char *s, size_t maxlen);
+char *strrchr(const char *p, int ch);
 
 #endif /* STRING_H */
index 554f36bb7a7b5dc195205f06afbdba9131ba2747..daa2ec102cb86b20d1560faabbf4be2f27133ab3 100644 (file)
@@ -21,7 +21,8 @@ LIBC_SRCS     :=      $(addprefix lib/libc/,  \
                        strcmp.c                        \
                        strlen.c                        \
                        strncmp.c                       \
-                       strnlen.c)
+                       strnlen.c                       \
+                       strrchr.c)
 
 INCLUDES       +=      -Iinclude/lib/libc              \
                        -Iinclude/lib/libc/$(ARCH)      \
index 6afb8c1a497fb044b8f97f44fd591e0a48910832..cd435ff3e699d271054a42df31d58c396b95c383 100644 (file)
  * SUCH DAMAGE.
  */
 
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rindex.c   8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
 #include <stddef.h>
 #include <string.h>
 
@@ -53,5 +47,3 @@ strrchr(const char *p, int ch)
        }
        /* NOTREACHED */
 }
-
-__weak_reference(strrchr, rindex);