diff --git a/inc/stdlib.h b/inc/stdlib.h index c6d981d..0a77862 100644 --- a/inc/stdlib.h +++ b/inc/stdlib.h @@ -8,6 +8,7 @@ #define alloca(...) __builtin_alloca(__VA_ARGS__) +#define RAND_MAX UINT32_MAX #ifdef __cplusplus @@ -30,6 +31,9 @@ void abort(void); +void srand(uint32_t seed); +int32_t rand(void); + static inline int32_t abs(int32_t a) { diff --git a/src/stdlib.c b/src/stdlib.c index 90b9839..66c19a7 100644 --- a/src/stdlib.c +++ b/src/stdlib.c @@ -320,3 +320,17 @@ assert(p); return rtmsize(&l_malloc_context, p); } + + + +__attribute__ ((weak)) +void srand(uint32_t seed) +{ + +} + +__attribute__ ((weak)) +int32_t rand(void) +{ + return 0xDEADBEEF; +}