From ddb13ae6d87f92264e48ebd3bdbe1ded33437600 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 5 Feb 2019 13:38:32 +0100 Subject: LibC: Add some integer functionality needed for NASM. --- LibC/stdlib.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'LibC/stdlib.cpp') diff --git a/LibC/stdlib.cpp b/LibC/stdlib.cpp index 74fcfd9436..7afa23b98a 100644 --- a/LibC/stdlib.cpp +++ b/LibC/stdlib.cpp @@ -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; +} + } -- cgit v1.2.3