diff options
author | Brian <brian@yutani.localnet.net> | 2007-02-22 08:53:33 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-02-22 08:53:33 -0700 |
commit | 29c471aafc6a3fef23d553e31a555d1782854a77 (patch) | |
tree | 335385fd55d510118346136c6feb4daa707988b6 /src/mesa/main/imports.h | |
parent | 6d4cf6be4e79c3a6ab18272577df17389e3834a6 (diff) | |
parent | a4b344baa2484c65a1618f3cce3a94c91dea8ef7 (diff) |
Merge branch 'origin' into glsl-compiler-1
Conflicts:
src/mesa/main/state.c
src/mesa/shader/program.c
src/mesa/shader/program.h
src/mesa/shader/programopt.c
src/mesa/shader/slang/slang_execute.c
src/mesa/sources
src/mesa/swrast/s_arbshader.c
src/mesa/swrast/s_context.c
src/mesa/swrast/s_span.c
src/mesa/swrast/s_zoom.c
src/mesa/tnl/t_context.c
src/mesa/tnl/t_save_api.c
src/mesa/tnl/t_vb_arbprogram.c
src/mesa/tnl/t_vp_build.c
src/mesa/tnl/t_vtx_eval.c
Diffstat (limited to 'src/mesa/main/imports.h')
-rw-r--r-- | src/mesa/main/imports.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index dad2767e72..0633b3b8bf 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -138,13 +138,16 @@ typedef union { GLfloat f; GLint i; } fi_type; #define M_E (2.7182818284590452354) #endif -#ifndef FLT_MAX_EXP -#define FLT_MAX_EXP 128 +#ifndef ONE_DIV_LN2 +#define ONE_DIV_LN2 (1.442695040888963456) +#endif + +#ifndef ONE_DIV_SQRT_LN2 +#define ONE_DIV_SQRT_LN2 (1.201122408786449815) #endif -/* XXX this is a bit of a hack needed for compilation within XFree86 */ -#ifndef FLT_MIN -#define FLT_MIN (1.0e-37) +#ifndef FLT_MAX_EXP +#define FLT_MAX_EXP 128 #endif /* Degrees to radians conversion: */ @@ -173,8 +176,6 @@ typedef union { GLfloat f; GLint i; } fi_type; ***/ #if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */ # define SQRTF(X) _mesa_sqrtf(X) -#elif defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER) -# define SQRTF(X) (float) xf86sqrt((float) (X)) #else # define SQRTF(X) (float) sqrt((float) (X)) #endif @@ -221,8 +222,6 @@ static INLINE GLfloat LOG2(GLfloat val) num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3; return num.f + log_2; } -#elif defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER) -#define LOG2(x) ((GLfloat) (xf86log(x) * 1.442695)) #else /* * NOTE: log_base_2(x) = log(x) / log(2) @@ -293,15 +292,7 @@ static INLINE int GET_FLOAT_BITS( float x ) *** LDEXPF: multiply value by an integral power of two *** FREXPF: extract mantissa and exponent from value ***/ -#if defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER) -#define CEILF(x) ((GLfloat) xf86ceil(x)) -#define FLOORF(x) ((GLfloat) xf86floor(x)) -#define FABSF(x) ((GLfloat) xf86fabs(x)) -#define LOGF(x) ((GLfloat) xf86log(x)) -#define EXPF(x) ((GLfloat) xf86exp(x)) -#define LDEXPF(x,y) ((GLfloat) xf86ldexp(x,y)) -#define FREXPF(x,y) ((GLfloat) xf86frexp(x,y)) -#elif defined(__gnu_linux__) +#if defined(__gnu_linux__) /* C99 functions */ #define CEILF(x) ceilf(x) #define FLOORF(x) floorf(x) @@ -705,6 +696,9 @@ _mesa_pow(double x, double y); extern int _mesa_ffs(int i); +extern int +_mesa_ffsll(long long i); + extern unsigned int _mesa_bitcount(unsigned int n); |