From 29e2a3b8f5e75508202cd651d16648256f303779 Mon Sep 17 00:00:00 2001 From: Greg V Date: Thu, 23 Apr 2020 16:15:38 +0300 Subject: [PATCH] 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: --- src/gallium/winsys/sw/dri/dri_sw_winsys.c | 6 ++++++ src/util/u_thread.h | 4 ++++ 2 files changed, 10 insertions(+) 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 -- 2.30.2