summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-03-20 16:03:07 -0700
committerKenneth Graunke <[email protected]>2017-03-21 14:10:17 -0700
commitb15038a28991c73b4bd26c30cf1f0aba20d42d53 (patch)
tree47e54a7d2fc9f577a0fb4001d16419776a112de8 /src
parent0c3fbf8028b6f44a341548d341fa660e6b120647 (diff)
i965: Shut up major()/minor() warnings.
Recent glibc generates this warning: brw_performance_query.c:1648:13: warning: In the GNU C Library, "minor" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "minor", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including <sys/types.h>. min = minor(sb.st_rdev); So, include sys/sysmacros.h to shut up the warning. v2: Use the AC_HEADER_MAJOR defines to figure out the right header (thanks to Jonathan Gray for helping me not break non-glibc systems) Reviewed-by: Matt Turner <[email protected]> [v1] Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_query.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c
index 2e04e091d29..4a94e4b3cc2 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query.c
@@ -42,6 +42,13 @@
#include <limits.h>
#include <dirent.h>
+/* put before sys/types.h to silence glibc warnings */
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>