gallium,util: undef ALIGN on FreeBSD to prevent name clash
authorGreg V <greg@unrelenting.technology>
Thu, 23 Apr 2020 13:15:38 +0000 (16:15 +0300)
committerMarge Bot <eric+marge@anholt.net>
Wed, 1 Jul 2020 16:47:05 +0000 (16:47 +0000)
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 <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3559>

src/gallium/winsys/sw/dri/dri_sw_winsys.c
src/util/u_thread.h

index c889e968534fb6b88340c843852f20d925da42f3..f9ff6d25d730138c2dfc19d9354461d1607c6664 100644 (file)
 #ifdef HAVE_SYS_SHM_H
 #include <sys/ipc.h>
 #include <sys/shm.h>
+#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"
index 1f2a104c3fd65e9747715294690aee6ec950df8b..b91d05e4cfd2aefa28cdb8e8aef9d25cdebbaec4 100644 (file)
 #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