Project:Toolchain/Glibc 2.26 porting notes/sysmacros.h

= Description =

To support upcoming  standards   plans to remove from 's. See the announcement.

defines the following macros:



Build breakage usually looks like that:

bdev/lxclvm.c: In function 'lvm_detect': bdev/lxclvm.c:140:4: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration] major(statbuf.st_rdev), minor(statbuf.st_rdev));   ^Grknight (talk) 14:53, 10 August 2021 (UTC)  bdev/lxclvm.c:140:28: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration]    major(statbuf.st_rdev), minor(statbuf.st_rdev)); ^Grknight (talk) 14:53, 10 August 2021 (UTC)

= How to fix =

autoconf-based systems
Note:  is a non-standard header. Most portable fix across various libcs is to use [AC_HEADER_MAJOR] macro.

AC_HEADER_MAJOR
 * 1) somewhere in configure.ac:
 * 2) lookup major/minor/makedev

= Links =


 * Autocong manual: AC_HEADER_MAJOR
 * Tracking bug:
 * Example fix: https://github.com/lxc/lxc/commit/af6824fce9c9536fbcabef8d5547f6c486f55fdf