[cairo] sincos patch final(?) patch

John Ellson ellson at research.att.com
Tue Sep 13 08:06:50 PDT 2005


Behdad Esfahbod wrote:

>Thanks Carl,
>
>Apparently with that problem, sincos is not worth using.
>
...

>>
>>Cairo previously had one call to sincos in its implementation. As it
>>turned out, that call caused problems on Tru64 where sincos apparently
>>doesn't work.
>>
...

Here is the configure check that we use in graphviz to ensure a working 
implementation of sincos()

I would like to see the efficiency test done before rejecting the use 
use of sincos()
when it is available and working.

John

------------------------------------------

AC_MSG_CHECKING(if have working sincos())
AC_TRY_RUN([
        #include <stdio.h>
        #include <assert.h>
        #define PI 3.14159265358979323846
        extern void sincos(double x, double *s, double *c);
        int main () {
                double sinx=0.0, cosx=1.0;
                sincos(PI/2.0,&sinx,&cosx);
                assert(sinx>0.9999999);
                assert(sinx<1.0000001);
                assert(cosx<0.0000001);
                assert(cosx>(-0.0000001));
                return 0;
        }]
        ,
        AC_MSG_RESULT(yes)
        AC_DEFINE_UNQUOTED(HAVE_SINCOS,1,[Define if libm provides a 
*working* sincos function])
        ,
        AC_MSG_RESULT(no)
        ,
        AC_MSG_RESULT(no - assumed because cross-compiling)
        )



More information about the cairo mailing list