From: Greg V Date: Thu, 23 Apr 2020 13:15:38 +0000 (+0300) Subject: gallium,util: undef ALIGN on FreeBSD to prevent name clash X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29e2a3b8f5e75508202cd651d16648256f303779;p=mesa.git gallium,util: undef ALIGN on FreeBSD to prevent name clash Some rare headers like ipc/shm and pthread_np cause machine/param.h to be included which defines a macro called ALIGN. Signed-off-by: Matt Turner Part-of: --- diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c index c889e968534..f9ff6d25d73 100644 --- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c +++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c @@ -29,6 +29,12 @@ #ifdef HAVE_SYS_SHM_H #include #include +#ifdef __FreeBSD__ +/* sys/ipc.h -> sys/_types.h -> machine/param.h + * - defines ALIGN which clashes with our ALIGN + */ +#undef ALIGN +#endif #endif #include "pipe/p_compiler.h" diff --git a/src/util/u_thread.h b/src/util/u_thread.h index 1f2a104c3fd..b91d05e4cfd 100644 --- a/src/util/u_thread.h +++ b/src/util/u_thread.h @@ -45,6 +45,10 @@ #endif #ifdef __FreeBSD__ +/* pthread_np.h -> sys/param.h -> machine/param.h + * - defines ALIGN which clashes with our ALIGN + */ +#undef ALIGN #define cpu_set_t cpuset_t #endif