mlibc: Tinycc support: __udivdi3, __umoddi3.

* lib/libc+tcc-gcc.c (__udivdi3, __umoddi3): Fix signature, do not
  crash on simple integer devisions.
This commit is contained in:
Jan Nieuwenhuizen 2017-12-03 20:40:49 +01:00
parent 4ce75e8f4b
commit 7a7bcda79e

View file

@ -80,14 +80,18 @@ setjmp (jmp_buf env)
return 0;
}
int
__udivdi3 (int a, int b)
unsigned long long
__udivdi3 (unsigned long long a, unsigned long long b)
{
return a / b;
int ai = a;
int bi = b;
return ai / bi;
}
int
__umoddi3 (int a, int b)
unsigned long long
__umoddi3 (unsigned long long a, unsigned long long b)
{
return a % b;
int ai = a;
int bi = b;
return ai % bi;
}