Define ffs() for __WIN32__ & __MSC__.
Break mesa dependencies.
This commit is contained in:
14
src/mesa/pipe/p_util.h
Executable file → Normal file
14
src/mesa/pipe/p_util.h
Executable file → Normal file
@@ -38,6 +38,18 @@
|
|||||||
|
|
||||||
#define Elements(x) sizeof(x)/sizeof(*(x))
|
#define Elements(x) sizeof(x)/sizeof(*(x))
|
||||||
|
|
||||||
|
#if defined(__MSC__) && defined(__WIN32__)
|
||||||
|
static INLINE unsigned ffs( unsigned u )
|
||||||
|
{
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
__asm bsf eax, [u]
|
||||||
|
__asm mov [i], eax
|
||||||
|
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
union fi {
|
union fi {
|
||||||
float f;
|
float f;
|
||||||
int i;
|
int i;
|
||||||
@@ -165,7 +177,7 @@ static INLINE int iround(float f)
|
|||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#define FABSF(x) fabsf(x)
|
#define FABSF(x) fabsf(x)
|
||||||
#else
|
#else
|
||||||
#define FABSF(x) ((GLfloat) fabs(x))
|
#define FABSF(x) ((float) fabs(x))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Pretty fast, and accurate.
|
/* Pretty fast, and accurate.
|
||||||
|
Reference in New Issue
Block a user