X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=qv27i71OW9OezCE+npkpCu0sq0I2GCCvJVugAfUGVUUm75r9UY0mZ57SnbLQWo+c9C6nPMpOaisGQrjz5+qJW1YTGf3PLuwfv9mCPRiyzidy88yIIBbSF6uCyPaYxM941DFQfx8vodcqClQ2d2WlNzBOUPoTpPdW5rK3KfysDKM= Message-ID: <2497d9a2050802141537ca5ba8@mail.gmail.com> Date: Tue, 2 Aug 2005 17:15:02 -0400 From: Matthew Petricone To: djgpp AT delorie DOT com Subject: ___divdi3 and ___moddi3 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_14104_5990509.1123017302074" Reply-To: djgpp AT delorie DOT com ------=_Part_14104_5990509.1123017302074 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Now that I have code that compiles, there seems to be a linking error with= =20 the folowing code. void bc_puti(long long fmt, int base) { static char buf[32] =3D {0}; int i =3D 30; if (fmt < 0) { bc_pchar('-');=20 fmt =3D -fmt; } for (;fmt && i;fmt /=3D base) { buf[i] =3D "0123456789abcdef"[fmt % base]; } bc_puts(buf); }=20 it compiles ok. but it won't like either with djgpp's ld or ld-elf it gives the following errors: undifined reference to '___moddi3' and undifined reference to '___divdi3' as i understand it they are gcc internals used for division and modulus=20 operations. Is there anway around this short of writing assembly for modulu= s=20 and division? ------=_Part_14104_5990509.1123017302074 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Now that I have code that compiles, there seems to be a linking error&= nbsp; with the folowing code.
 
void bc_puti(long long fmt, int base)
{
    = static char buf[32] =3D {0};
     int i =3D 30;
=      if (fmt < 0)
     {
&= nbsp;     bc_pchar('-');     &= nbsp;
      fmt =3D -fmt;
   = ;  }
        for (;fmt &&= ; i;fmt /=3D base)
        {
    = ;     buf[i] =3D "0123456789abcdef"[fmt % bas= e];
        }
   &n= bsp; bc_puts(buf);
}
 
 it compiles ok. but it won't like either with djgpp's ld or ld-e= lf
 
it gives the following errors: undifined reference to '___moddi3'
and           &= nbsp;           &nbs= p;           undifin= ed reference to '___divdi3'
 
as i understand it they are gcc internals used for division and modulu= s operations. Is there anway around this short of writing assembly for modu= lus and division?
------=_Part_14104_5990509.1123017302074--