Add generic strlen implementation
This commit is contained in:
parent
d47709b03c
commit
9163857e83
@ -17,6 +17,15 @@ void *memset(void* s, int c, unsigned long n) {
|
|||||||
}
|
}
|
||||||
#endif // !MEMSET_DEFINED
|
#endif // !MEMSET_DEFINED
|
||||||
|
|
||||||
|
#ifndef _STRLEN_DEFINED
|
||||||
|
#define _STRLEN_DEFINED
|
||||||
|
int strlen(char* s) {
|
||||||
|
int len = 0;
|
||||||
|
for(;s[len] != 0; ++len);
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
#endif // !_STRLEN_DEFINED
|
||||||
|
|
||||||
#ifndef _START_DEFINED
|
#ifndef _START_DEFINED
|
||||||
#define _START_DEFINED
|
#define _START_DEFINED
|
||||||
// Generic _start implementation. Can't access any args
|
// Generic _start implementation. Can't access any args
|
||||||
|
|||||||
1
sys.h
1
sys.h
@ -143,5 +143,6 @@ int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *t, stru
|
|||||||
uint32_t fork();
|
uint32_t fork();
|
||||||
|
|
||||||
void *memset(void* s, int c, unsigned long n);
|
void *memset(void* s, int c, unsigned long n);
|
||||||
|
int strlen(char* s);
|
||||||
|
|
||||||
#endif // !MINIMALSYS_H
|
#endif // !MINIMALSYS_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user