[Mesa-dev] [PATCH v2] isl: remove ffs function that conflicts with system headers

Jason Ekstrand jason at jlekstrand.net
Sat Apr 23 14:36:16 UTC 2016


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

In general, we should be using mesa compat headers for this sort of thing
rather than hand-rolling it.
On Apr 23, 2016 12:28 AM, "Jonathan Gray" <jsg at jsg.id.au> wrote:

> Remove a wrapper around __builtin_ffs that conflicts with system
> headers on OpenBSD and perhaps elsewhere:
>
> isl_priv.h:44: error: conflicting types for 'ffs'
>
> v2: include strings.h to ensure prototype is found
>
> Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
> ---
>  src/intel/isl/isl_priv.h | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/intel/isl/isl_priv.h b/src/intel/isl/isl_priv.h
> index 7b22259..d98e707 100644
> --- a/src/intel/isl/isl_priv.h
> +++ b/src/intel/isl/isl_priv.h
> @@ -24,6 +24,7 @@
>  #pragma once
>
>  #include <assert.h>
> +#include <strings.h>
>
>  #include "brw_device_info.h"
>  #include "util/macros.h"
> @@ -39,11 +40,6 @@ __isl_finishme(const char *file, int line, const char
> *fmt, ...);
>  #define MIN(a, b) ((a) < (b) ? (a) : (b))
>  #define MAX(a, b) ((a) > (b) ? (a) : (b))
>
> -static inline uint32_t
> -ffs(uint32_t n) {
> -   return __builtin_ffs(n);
> -}
> -
>  static inline bool
>  isl_is_pow2(uintmax_t n)
>  {
> --
> 2.8.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160423/44704578/attachment.html>


More information about the mesa-dev mailing list