mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
* include/cygwin/types.h: Move #include <sys/sysmacros.h> to
end of header so that it gets the dev_t typedef. * include/sys/sysmacros.h (gnu_dev_major, gnu_dev_minor, gnu_dev_makedev): Prototype and define as inline functions. (major, minor, makedev): Redefine in terms of gnu_dev_*.
This commit is contained in:
parent
8b09538c94
commit
ddebf19a2a
@ -1,3 +1,11 @@
|
|||||||
|
2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
|
||||||
|
|
||||||
|
* include/cygwin/types.h: Move #include <sys/sysmacros.h> to
|
||||||
|
end of header so that it gets the dev_t typedef.
|
||||||
|
* include/sys/sysmacros.h (gnu_dev_major, gnu_dev_minor,
|
||||||
|
gnu_dev_makedev): Prototype and define as inline functions.
|
||||||
|
(major, minor, makedev): Redefine in terms of gnu_dev_*.
|
||||||
|
|
||||||
2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
|
2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
|
||||||
|
|
||||||
* include/cygwin/types.h: Move multiple inclusion guards to
|
* include/cygwin/types.h: Move multiple inclusion guards to
|
||||||
|
@ -17,7 +17,6 @@ extern "C"
|
|||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/sysmacros.h>
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
|
|
||||||
@ -219,6 +218,9 @@ typedef class pthread_rwlockattr *pthread_rwlockattr_t;
|
|||||||
typedef class semaphore *sem_t;
|
typedef class semaphore *sem_t;
|
||||||
#endif /* __INSIDE_CYGWIN__ */
|
#endif /* __INSIDE_CYGWIN__ */
|
||||||
|
|
||||||
|
/* this header needs the dev_t typedef */
|
||||||
|
#include <sys/sysmacros.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* sys/sysmacros.h
|
/* sys/sysmacros.h
|
||||||
|
|
||||||
Copyright 1998, 2001, 2010 Red Hat, Inc.
|
Copyright 1998, 2001, 2010, 2011 Red Hat, Inc.
|
||||||
|
|
||||||
This file is part of Cygwin.
|
This file is part of Cygwin.
|
||||||
|
|
||||||
@ -11,8 +11,30 @@ details. */
|
|||||||
#ifndef _SYS_SYSMACROS_H
|
#ifndef _SYS_SYSMACROS_H
|
||||||
#define _SYS_SYSMACROS_H
|
#define _SYS_SYSMACROS_H
|
||||||
|
|
||||||
#define major(dev) ((int)(((dev) >> 16) & 0xffff))
|
_ELIDABLE_INLINE int gnu_dev_major(dev_t);
|
||||||
#define minor(dev) ((int)((dev) & 0xffff))
|
_ELIDABLE_INLINE int gnu_dev_minor(dev_t);
|
||||||
#define makedev(major, minor) (((major) << 16) | ((minor) & 0xffff))
|
_ELIDABLE_INLINE dev_t gnu_dev_makedev(int, int);
|
||||||
|
|
||||||
|
_ELIDABLE_INLINE int
|
||||||
|
gnu_dev_major(dev_t dev)
|
||||||
|
{
|
||||||
|
return (int)(((dev) >> 16) & 0xffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
_ELIDABLE_INLINE int
|
||||||
|
gnu_dev_minor(dev_t dev)
|
||||||
|
{
|
||||||
|
return (int)((dev) & 0xffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
_ELIDABLE_INLINE dev_t
|
||||||
|
gnu_dev_makedev(int maj, int min)
|
||||||
|
{
|
||||||
|
return (((maj) << 16) | ((min) & 0xffff));
|
||||||
|
}
|
||||||
|
|
||||||
|
#define major(dev) gnu_dev_major(dev)
|
||||||
|
#define minor(dev) gnu_dev_minor(dev)
|
||||||
|
#define makedev(maj, min) gnu_dev_makedev(maj, min)
|
||||||
|
|
||||||
#endif /* _SYS_SYSMACROS_H */
|
#endif /* _SYS_SYSMACROS_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user