Add srand to stdlib

This commit is contained in:
drmortalwombat 2022-05-09 22:18:34 +02:00
parent b85b222fc0
commit 2feb8b9e6d
2 changed files with 7 additions and 1 deletions

View File

@ -444,7 +444,7 @@ void * calloc(int num, int size)
return p;
}
unsigned seed = 31232;
static unsigned seed = 31232;
unsigned int rand(void)
{
@ -454,3 +454,7 @@ unsigned int rand(void)
return seed;
}
void srand(unsigned int s)
{
seed = s;
}

View File

@ -29,6 +29,8 @@ void * calloc(int num, int size);
unsigned int rand(void);
void srand(unsigned int seed);
#pragma compile("stdlib.c")
#endif