diff options
author | Brian Paul <[email protected]> | 2005-09-20 02:44:40 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-09-20 02:44:40 +0000 |
commit | cd81190d5c5f7064e0013eb313f2ad5da863fad7 (patch) | |
tree | 1f03ed0b78a3d7ccc885cbd07043af2dc14dc051 | |
parent | 17d6fff30c6696b1624e1c019d31f22332c74622 (diff) |
change location of ffs() code for windows
-rw-r--r-- | src/mesa/main/imports.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index f7d9de36697..3bf9b95a0b5 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -31,7 +31,7 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * @@ -528,27 +528,20 @@ _mesa_pow(double x, double y) } -/* Windows does not have the ffs() function */ -#if defined(_WIN32) && !defined(__MINGW32__) -int INLINE ffs(int value) -{ - int bit; - if (value == 0) - return 0; - for (bit=1; !(value & 1); bit++) - value >>= 1; - return bit; -} -#endif - - /** - * Wrapper around either ffs() or xf86ffs(). + * Find the first bit set in a word. */ int _mesa_ffs(int i) { -#if defined(XFree86LOADER) && defined(IN_MODULE) +#if defined(_WIN32) && !defined(__MINGW32__) + int bit; + if (i == 0) + return 0; + for (bit = 1; !(i & 1); bit++) + i >>= 1; + return bit; +#elif defined(XFree86LOADER) && defined(IN_MODULE) return xf86ffs(i); #else return ffs(i); |