Use frexp on Windows; frexpf is not available.

This commit is contained in:
Karl Schultz
2005-07-01 15:58:02 +00:00
parent 9b56781986
commit 7fe8696d01

View File

@@ -345,7 +345,11 @@ static void do_LOG( struct arb_vp_machine *m, union instruction op )
const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0];
GLfloat tmp = FABSF(arg0[0]); GLfloat tmp = FABSF(arg0[0]);
int exponent; int exponent;
#ifdef _WIN32
GLfloat mantissa = (GLfloat) frexp((double)tmp, &exponent);
#else
GLfloat mantissa = frexpf(tmp, &exponent); GLfloat mantissa = frexpf(tmp, &exponent);
#endif
result[0] = (GLfloat) (exponent - 1); result[0] = (GLfloat) (exponent - 1);
result[1] = 2.0 * mantissa; /* map [.5, 1) -> [1, 2) */ result[1] = 2.0 * mantissa; /* map [.5, 1) -> [1, 2) */