[Bug 2442] glxgears should use sincos(3)
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Feb 1 01:17:12 PST 2005
Please do not reply to this email: if you want to comment on the bug, go to
the URL shown below and enter yourcomments there.
https://bugs.freedesktop.org/show_bug.cgi?id=2442
------- Additional Comments From mharris at www.linux.org.uk 2005-02-01 01:17 -------
Additional Comment #1 From John Ellson (ellson at research.att.com) on 2003-06-13
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
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the xorg-bugzilla-noise
mailing list