diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-11-27 23:01:14 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-28 13:01:14 +1100 |
| commit | 7649cd309af155de1b8ee8bfd32d850e46f27925 (patch) | |
| tree | 8c66e552901046c002e951691fb063bf5be2b00f /include/libc | |
| parent | 2fdcdd91b332d234a823e43607978e010152b811 (diff) | |
Organize `libc` and `libm` files (#1499)
* memmove
* strcpy
* strcmp
* memset
* fmodf
* fix some missing includes
* Remove libc header dependencies on libultra
* fix
* review
Diffstat (limited to 'include/libc')
| -rw-r--r-- | include/libc/math.h | 2 | ||||
| -rw-r--r-- | include/libc/stddef.h | 11 | ||||
| -rw-r--r-- | include/libc/string.h | 5 |
3 files changed, 15 insertions, 3 deletions
diff --git a/include/libc/math.h b/include/libc/math.h index 6e904dca8..25d9e5a93 100644 --- a/include/libc/math.h +++ b/include/libc/math.h @@ -17,4 +17,6 @@ float fabsf(float f); double sqrt(double d); #pragma intrinsic(sqrt) +float fmodf(float dividend, float divisor); + #endif diff --git a/include/libc/stddef.h b/include/libc/stddef.h index d75339614..3b4ed699c 100644 --- a/include/libc/stddef.h +++ b/include/libc/stddef.h @@ -1,9 +1,16 @@ #ifndef LIBC_STDDEF_H #define LIBC_STDDEF_H -#include "PR/ultratypes.h" +#if !defined(_SIZE_T) +#define _SIZE_T +#if defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64) +typedef unsigned long size_t; +#else +typedef unsigned int size_t; +#endif +#endif -typedef s32 ptrdiff_t; +typedef signed long ptrdiff_t; #ifdef __GNUC__ #define offsetof(structure, member) __builtin_offsetof (structure, member) diff --git a/include/libc/string.h b/include/libc/string.h index 9c6a1cb08..4fb99e71e 100644 --- a/include/libc/string.h +++ b/include/libc/string.h @@ -3,10 +3,13 @@ #include "libc/stddef.h" - const char* strchr(const char* s, int c); size_t strlen(const char* s); void* memcpy(void* s1, const void* s2, size_t n); +void* memset(void* ptr, int val, size_t size); +int strcmp(const char* str1, const char* str2); +char* strcpy(char* dst, const char* src); +void* memmove(void* dst, const void* src, size_t size); #endif |
