Mail Archives: cygwin-developers/1998/11/13/16:48:23
> As mentioned in `gnu-win32 AT cygnus DOT com', it's important
> to have defines for `major', `minor' and `makedev' to
> compile the package file-3.XX.
>
> So it would be nice, to have the file `sys/sysmacros.h'
> in the includes, as in Linux and others.
OK, I'll add it.
> ---- snip ----
> #ifndef _SYS_SYSMACROS_H
> #define _SYS_SYSMACROS_H
>
> #define major(dev) (((unsigned) (dev))>>8)
> #define minor(dev) ((dev)&0xff)
> #define makedev(major,minor) (((major)<<8)|(minor))
>
> #endif /* _SYS_SYSMACROS_H */
On question though. On my linux box, the define for major/minor looks
like:
#define major(dev) ((int)(((dev) >> 8) & 0xff))
#define minor(dev) ((int)((dev) & 0xff))
#define makedev(major, minor) (((major) << 8) | (minor))
Which should I use? Why does yours cast dev to unsigned whereas
the Linux one does not?
--
Geoffrey Noer
noer AT cygnus DOT com
- Raw text -