libc: Introduce cdefs.h, assert.h and strlen.c

Change-Id: I76091d52571f1950111c4b1670d5fc3883607715
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
This commit is contained in:
Antonio Nino Diaz 2018-08-13 19:51:26 +01:00
parent 4661abc7c4
commit 8bb6de1518
3 changed files with 84 additions and 0 deletions

17
lib/libc/strlen.c Normal file
View file

@ -0,0 +1,17 @@
/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <string.h>
size_t strlen(const char *s)
{
const char *cursor = s;
while (*cursor)
cursor++;
return cursor - s;
}