A rather low priority thing to fiddle with sometime when bored perhaps. <jakub> btw: glxgears should be tought about sincos(3) <jakub> I saw in ltrace lots of sin calls followed by cos calls with the same arguments
sincos() is not very portable. Here is the configure test and a sincos macro that we've used with success in graphviz: --------------------- configure test ----------------------- 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) ) ------------------ macro --------------------- #ifndef HAVE_SINCOS void sincos(x,s,c) double x,*s,*c; { *s = sin(x); *c = cos(x); } #else extern void sincos(double x, double *s, double *c); #endif
Filed bug report upstream to track this low priority enhancement suggestion, in case some enterprising new X developer wants a simple task to dip their toes into Imake et al.: https://bugs.freedesktop.org/show_bug.cgi?id=2442 Setting our bug status to "UPSTREAM" to continue tracking it in centralized location instead.