From: Kenneth Graunke Date: Mon, 20 Mar 2017 23:03:07 +0000 (-0700) Subject: i965: Shut up major()/minor() warnings. X-Git-Tag: upstream/17.1.0~1164 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b15038a28991c73b4bd26c30cf1f0aba20d42d53;p=platform%2Fupstream%2Fmesa.git 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 . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "minor", include directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including . 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 [v1] Reviewed-by: Emil Velikov --- diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index 2e04e09..4a94e4b 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 #include +/* put before sys/types.h to silence glibc warnings */ +#ifdef MAJOR_IN_MKDEV +#include +#endif +#ifdef MAJOR_IN_SYSMACROS +#include +#endif #include #include #include