diff --git a/programs/develop/ktcc/trunk/bin/lib/libc.obj.a b/programs/develop/ktcc/trunk/bin/lib/libc.obj.a index 331333aff1..5c7878caed 100644 Binary files a/programs/develop/ktcc/trunk/bin/lib/libc.obj.a and b/programs/develop/ktcc/trunk/bin/lib/libc.obj.a differ diff --git a/programs/develop/ktcc/trunk/libc.obj/include/stdlib.h b/programs/develop/ktcc/trunk/libc.obj/include/stdlib.h index 532474e39f..e39f5a9910 100644 --- a/programs/develop/ktcc/trunk/libc.obj/include/stdlib.h +++ b/programs/develop/ktcc/trunk/libc.obj/include/stdlib.h @@ -20,13 +20,35 @@ extern int _FUNC(abs)(int); extern long _FUNC(labs)(long); extern long long _FUNC(llabs)(long long); -typedef struct { int quot, rem; } div_t; -typedef struct { long quot, rem; } ldiv_t; -typedef struct { long long quot, rem; } lldiv_t; +typedef struct { + int quot; + int rem; +} div_t; -extern div_t _FUNC(div)(int, int); -extern ldiv_t _FUNC(ldiv)(long, long); -extern lldiv_t _FUNC(lldiv)(long long, long long); +typedef struct { + long quot; + long rem; +} ldiv_t; + +typedef struct { + long long quot; + long long rem; +} lldiv_t; + +static inline +div_t div(int num, int den) { + return (div_t){ num/den, num%den }; +} + +static inline +ldiv_t ldiv(long num, long den) { + return (ldiv_t){ num/den, num%den }; +} + +static inline +lldiv_t lldiv(long long num, long long den) { + return (lldiv_t){ num/den, num%den }; +} extern void* _FUNC(malloc)(size_t size); extern void* _FUNC(calloc)(size_t num, size_t size); diff --git a/programs/develop/ktcc/trunk/libc.obj/source/libc.c b/programs/develop/ktcc/trunk/libc.obj/source/libc.c index 16bb0c8806..b1799af8fc 100644 --- a/programs/develop/ktcc/trunk/libc.obj/source/libc.c +++ b/programs/develop/ktcc/trunk/libc.obj/source/libc.c @@ -82,7 +82,6 @@ #include "string/memmove.c" #include "stdlib/calloc.c" -#include "stdlib/lldiv.c" #include "stdlib/malloc.c" #include "stdlib/atoll.c" #include "stdlib/free.c" @@ -91,9 +90,7 @@ #include "stdlib/atoi.c" #include "stdlib/labs.c" #include "stdlib/realloc.c" -#include "stdlib/ldiv.c" #include "stdlib/abs.c" -#include "stdlib/div.c" #include "stdlib/atol.c" #include "stdlib/itoa.c" #include "stdlib/strtol.c" diff --git a/programs/develop/ktcc/trunk/libc.obj/source/stdlib/div.c b/programs/develop/ktcc/trunk/libc.obj/source/stdlib/div.c deleted file mode 100644 index 99bce10157..0000000000 --- a/programs/develop/ktcc/trunk/libc.obj/source/stdlib/div.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -div_t div(int num, int den) -{ - return (div_t){ num/den, num%den }; -} \ No newline at end of file diff --git a/programs/develop/ktcc/trunk/libc.obj/source/stdlib/ldiv.c b/programs/develop/ktcc/trunk/libc.obj/source/stdlib/ldiv.c deleted file mode 100644 index e19a084ea2..0000000000 --- a/programs/develop/ktcc/trunk/libc.obj/source/stdlib/ldiv.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -ldiv_t ldiv(long num, long den) -{ - return (ldiv_t){ num/den, num%den }; -} \ No newline at end of file diff --git a/programs/develop/ktcc/trunk/libc.obj/source/stdlib/lldiv.c b/programs/develop/ktcc/trunk/libc.obj/source/stdlib/lldiv.c deleted file mode 100644 index 7d589145c5..0000000000 --- a/programs/develop/ktcc/trunk/libc.obj/source/stdlib/lldiv.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -lldiv_t lldiv(long long num, long long den) -{ - return (lldiv_t){ num/den, num%den }; -} \ No newline at end of file diff --git a/programs/develop/ktcc/trunk/libc.obj/source/symbols.txt b/programs/develop/ktcc/trunk/libc.obj/source/symbols.txt index 8da25ec0f6..8245b893dc 100644 --- a/programs/develop/ktcc/trunk/libc.obj/source/symbols.txt +++ b/programs/develop/ktcc/trunk/libc.obj/source/symbols.txt @@ -49,14 +49,11 @@ atol atoll atof calloc -div exit free itoa labs -ldiv llabs -lldiv malloc realloc strtol