This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Macros "major" and "minor"

On Jun 15 14:41, Martin Magnusson wrote:
> I recently ran into problems when compiling a matrix library containing 
> a function called "minor". Apparently, the file 
> /usr/include/sys/sysmacros.h has the following definitions:
> #define major(dev) ((int)(((dev) >> 16) & 0xffff))
> #define minor(dev) ((int)((dev) & 0xffff))
> #define makedev(major, minor) (((major) << 16) | ((minor) & 0xffff))
> #else
> #define major(dev) ((int)(((dev) >> 8) & 0xff))
> #define minor(dev) ((int)((dev) & 0xff))
> #define makedev(major, minor) (((major) << 8) | ((minor) & 0xff))
> #endif
> Defining macros with names like "major" and "minor" is really not good, 
> IMO. This should probably be changed, if possible.

They are defined the same way on Linux or BSD.  They are also pulled
in there simply by including sys/types.h or another include file which
in turn includes sys/types.h.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader
Red Hat, Inc.

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]