aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/imports.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/imports.h')
-rw-r--r--mesalib/src/mesa/main/imports.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h
index b7e87439f..ce7b45d77 100644
--- a/mesalib/src/mesa/main/imports.h
+++ b/mesalib/src/mesa/main/imports.h
@@ -566,6 +566,9 @@ _mesa_inv_sqrtf(float x);
extern void
_mesa_init_sqrt_table(void);
+
+#ifndef FFS_DEFINED
+#define FFS_DEFINED 1
#ifdef __GNUC__
#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(ANDROID) || defined(__APPLE__)
@@ -573,10 +576,16 @@ _mesa_init_sqrt_table(void);
#define ffsll __builtin_ffsll
#endif
-#define _mesa_ffs(i) ffs(i)
-#define _mesa_ffsll(i) ffsll(i)
+#else
+
+extern int ffs(int i);
+extern int ffsll(long long int i);
+
+#endif /*__ GNUC__ */
+#endif /* FFS_DEFINED */
-#if ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */
+
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */
#define _mesa_bitcount(i) __builtin_popcount(i)
#define _mesa_bitcount_64(i) __builtin_popcountll(i)
#else
@@ -586,16 +595,6 @@ extern unsigned int
_mesa_bitcount_64(uint64_t n);
#endif
-#else
-extern int
-_mesa_ffs(int32_t i);
-
-extern int
-_mesa_ffsll(int64_t i);
-
-extern unsigned int
-_mesa_bitcount(unsigned int n);
-#endif
extern GLhalfARB
_mesa_float_to_half(float f);