LibC: Add some integer functionality needed for NASM.

This commit is contained in:
Andreas Kling 2019-02-05 13:38:32 +01:00
commit ddb13ae6d8
Notes: sideshowbarker 2024-07-19 15:51:20 +09:00
4 changed files with 29 additions and 0 deletions

View file

@ -267,4 +267,20 @@ int system(const char* command)
return execl("/bin/sh", "sh", "-c", command, nullptr);
}
div_t div(int numerator, int denominator)
{
div_t result;
result.quot = numerator / denominator;
result.rem = numerator % denominator;
return result;
}
ldiv_t ldiv(long numerator, long denominator)
{
ldiv_t result;
result.quot = numerator / denominator;
result.rem = numerator % denominator;
return result;
}
}