[igt-dev] [PATCH i-g-t 21/29] lib: undefine FreeBSD libc's ALIGN macro

D Scott Phillips d.scott.phillips at intel.com
Wed Dec 11 00:52:27 UTC 2019


On FreeBSD, if you include many of the non-POSIX headers, you get
inflicted with a definition of an ALIGN() macro that has something
to do with network protocols. Here we include a header that
provides it and then undefine it so that we can provide our own
definition.

Signed-off-by: D Scott Phillips <d.scott.phillips at intel.com>
---
 lib/drmtest.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/drmtest.h b/lib/drmtest.h
index 632c616b..0fc59311 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -33,6 +33,10 @@
 #include <stdint.h>
 #include <sys/mman.h>
 #include <errno.h>
+#if defined(__FreeBSD__)
+# include <sys/param.h>
+# undef ALIGN
+#endif
 
 #include <xf86drm.h>
 
-- 
2.23.0



More information about the igt-dev mailing list