Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/devices.h')
-rw-r--r--winsup/cygwin/devices.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/winsup/cygwin/devices.h b/winsup/cygwin/devices.h
index b4886d898..bdddb8ce4 100644
--- a/winsup/cygwin/devices.h
+++ b/winsup/cygwin/devices.h
@@ -14,7 +14,6 @@ details. */
typedef unsigned short _major_t;
typedef unsigned short _minor_t;
typedef mode_t _mode_t;
-typedef __dev32_t _dev_t;
#define FHDEV(maj, min) ((((unsigned) (maj)) << (sizeof (_major_t) * 8)) | (unsigned) (min))
#define _minor(dev) ((dev) & ((1 << (sizeof (_minor_t) * 8)) - 1))
@@ -263,7 +262,7 @@ struct device
const char *name;
union __cygwin_dev
{
- _dev_t devn;
+ dev_t devn;
DWORD devn_dword;
int devn_int;
fh_devices devn_fh_devices;
@@ -281,7 +280,7 @@ struct device
static const device *lookup (const char *, unsigned int = UINT32_MAX);
void parse (const char *);
void parse (_major_t major, _minor_t minor);
- void parse (_dev_t dev);
+ void parse (dev_t dev);
void parsedisk (int, int);
inline bool setunit (unsigned n)
{
@@ -290,32 +289,31 @@ struct device
}
static void init ();
- static _major_t major (_dev_t n)
+ static _major_t major (dev_t n)
{
__cygwin_dev d;
d.devn = n;
return d.major;
}
- static _minor_t minor (_dev_t n)
+ static _minor_t minor (dev_t n)
{
__cygwin_dev d;
d.devn = n;
return d.minor;
}
- static _major_t major (int n) {return major ((_dev_t) n);}
- static _minor_t minor (int n) {return minor ((_dev_t) n);}
+ static _major_t major (int n) {return major ((dev_t) n);}
+ static _minor_t minor (int n) {return minor ((dev_t) n);}
- bool is_device (_dev_t n) const {return n == d.devn; }
- bool not_device (_dev_t n) const {return d.devn && n != d.devn; }
+ bool is_device (dev_t n) const {return n == d.devn; }
+ bool not_device (dev_t n) const {return d.devn && n != d.devn; }
_minor_t get_minor () const {return d.minor;}
_major_t get_major () const {return d.major;}
- _dev_t get_device () const {return d.devn;}
+ dev_t get_device () const {return d.devn;}
- inline operator int& () {return d.devn_int;}
inline operator fh_devices () {return d.devn_fh_devices;}
inline operator bool () {return !!d.devn_int;}
- inline operator DWORD& () {return d.devn_dword;}
+ inline operator dev_t& () {return d.devn;}
fh_devices operator = (fh_devices n) {return d.devn_fh_devices = n;}
inline void setfs (bool x) {dev_on_fs = x;}
inline bool isfs () const {return dev_on_fs || d.devn == FH_FS;}
@@ -377,9 +375,9 @@ extern const device dev_fs_storage;
(isproc_dev (devn) || devn == FH_CYGDRIVE || devn == FH_NETDRIVE)
#define iscons_dev(n) \
- ((device::major ((int) (n)) == DEV_CONS_MAJOR) \
- || (((int) n) == FH_CONSOLE) \
- || (((int) n) == FH_CONIN) \
- || (((int) n) == FH_CONOUT))
+ ((device::major ((dev_t) (n)) == DEV_CONS_MAJOR) \
+ || (((dev_t) n) == FH_CONSOLE) \
+ || (((dev_t) n) == FH_CONIN) \
+ || (((dev_t) n) == FH_CONOUT))
#define istty_slave_dev(n) (device::major (n) == DEV_PTYS_MAJOR)