This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: atoll, llabs and lldiv
- From: "Artem B. Bityuckiy" <abitytsky at softminecorp dot com>
- To: newlib at sources dot redhat dot com
- Date: Tue, 25 Nov 2003 22:11:51 +0300
- Subject: Re: atoll, llabs and lldiv
- Organization: SoftMine Corporation
- References: <3FC39746.4090109@softminecorp.com>
- Reply-to: abitytsky at softminecorp dot com
And (was forgotten) the patch (attached) should be applied to
include/stdlib.h to add lldiv_t definition.
Artem B. Bityuckiy wrote:
Hello.
We've ported three functions from FreeBSD: llabs, lldiv and atoll (all
of them are from stdlib/).
They are rather trivial and I didn't test them therefore.
We've added documentation header, please, check it.
Also, I'm not sending a patch to stdlib/Makefile.am since I think it's
unneeded.
And question: is there any option in Newlib that switches on/off long
long support? If so, these functions should be segregated by the
appropriate macroses.
--
Best regards,
Artem B. Bityuckiy
SoftMine Corporation, Software Engineer
Tel.: +7(812)329-67-44, +7(812)329-67-45
Mobile: +79112449030
E-mail: abitytsky@softminecorp.com
Web: www.softminecorp.com
--- /home/dedekind/work/AnonymousCVSes/Newlib/src/newlib/libc/include/stdlib.h 2003-11-20 15:02:24.000000000 +0300
+++ newlib/libc/include/stdlib.h 2003-11-25 21:58:12.000000000 +0300
@@ -33,6 +33,12 @@
long rem; /* remainder */
} ldiv_t;
+typedef struct
+{
+ long long int quot; /* quotient */
+ long long int rem; /* remainder */
+} lldiv_t;
+
#ifndef NULL
#define NULL 0
#endif