portability: add sys/sysmacros.h wrapper for makedev/major/minor
parent
837d2fd915
commit
dd1908f2fc
|
@ -0,0 +1,9 @@
|
||||||
|
#ifdef __linux__
|
||||||
|
# include_next <sys/sysmacros.h>
|
||||||
|
#else
|
||||||
|
# include <stdint.h>
|
||||||
|
# include <sys/types.h>
|
||||||
|
# define major(x) ((int32_t)(((u_int32_t)(x) >> 24) & 0xff))
|
||||||
|
# define minor(x) ((int32_t)((x) & 0xffffff))
|
||||||
|
# define makedev(x, y) ((dev_t)(((x) << 24) | (y)))
|
||||||
|
#endif
|
Loading…
Reference in New Issue