[PATCH weston] configure: fix sys/sysmacros.h check
Pekka Paalanen
ppaalanen at gmail.com
Tue Dec 19 08:00:18 UTC 2017
On Mon, 18 Dec 2017 14:11:48 +0000
Daniel Stone <daniel at fooishbar.org> wrote:
> Hi,
>
> On 18 December 2017 at 08:24, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> > This patch is a copy of
> > https://cgit.freedesktop.org/mesa/drm/commit/?id=7040fea0280bad527ed4b3d5eee7d7bfbf303efc
> > by Adam Jackson.
> >
> > Commit 43c5a65b034a243700cf9c5bfbe6bcefb15f1161 "configure.ac: use
> > AC_HEADER_MAJOR to detect major()/minor()" started using AC_HEADER_MAJOR
> > to detect the header where major() is defined. This caused a regression
> > on systems where glibc is still providing a deprecated definition of
> > major() through sys/types.h, leading to a bunch of compiler warnings:
> >
> > /home/pq/git/weston/libweston/launcher-logind.c: In function ‘launcher_logind_open’:
> > /home/pq/git/weston/libweston/launcher-logind.c:182:13: warning: In the GNU C Library, "major" 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 "major", include <sys/sysmacros.h>
> > directly. If you did not intend to use a system-defined macro
> > "major", you should undefine it after including <sys/types.h>.
> > fd = launcher_logind_take_device(wl, major(st.st_rdev),
> >
> > The issue has been discussed earlier on
> > https://lists.gnu.org/archive/html/autoconf/2016-09/msg00013.html
> >
> > Work around the issue by causing the warning to trigger a build failure
> > inside AC_HEADER_MAJOR test, so that we get MAJOR_IN_SYSMACROS defined.
>
> Painful, but seems like the right thing to do.
>
> Reviewed-by: Daniel Stone <daniels at collabora.com>
Thank you Emil and Daniel, pushed:
8a9c8b08..14a7e371 master -> master
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20171219/19c868ea/attachment.sig>
More information about the wayland-devel
mailing list