aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-04-13 21:00:17 +0200
committerCorinna Vinschen <corinna@vinschen.de>2016-04-13 21:00:17 +0200
commit7b391244009ebca831aa8f8dac82112a9daa9023 (patch)
tree86bddf8c69af8681a14f9d62f2cc7e0f325348d5 /winsup
parentde51829c1747c0dd220f720ca84a51a818315b27 (diff)
downloadnewlib-7b391244009ebca831aa8f8dac82112a9daa9023.zip
newlib-7b391244009ebca831aa8f8dac82112a9daa9023.tar.gz
newlib-7b391244009ebca831aa8f8dac82112a9daa9023.tar.bz2
Get rid of some special cases for Cygwin in sys/types.h
Remove off_t typedef from cygwin/types.h thus relying on sys/types.h. Introduce winsup/cygwin/machine/_types.h and move some types shared with newlib into it. Get rid of their definition in cygwin/types.h. Add same handling for __key_t/key_t as for the other types. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/include/cygwin/types.h28
-rw-r--r--winsup/cygwin/include/machine/_types.h26
-rw-r--r--winsup/cygwin/include/sys/cygwin.h4
3 files changed, 27 insertions, 31 deletions
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index bdf4085..f9ed4b6 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -32,19 +32,8 @@ typedef struct timespec timespec_t;
typedef struct timespec timestruc_t;
#endif /*__timestruc_t_defined*/
-#ifndef __off_t_defined
-#define __off_t_defined
-typedef __off_t off_t;
-#endif /*__off_t_defined*/
-
typedef __loff_t loff_t;
-#ifndef __dev_t_defined
-#define __dev_t_defined
-typedef __int16_t __dev16_t;
-typedef __uint32_t dev_t;
-#endif /*__dev_t_defined*/
-
#ifndef __blksize_t_defined
#define __blksize_t_defined
typedef __int32_t blksize_t;
@@ -68,18 +57,6 @@ typedef unsigned long fsblkcnt_t;
typedef unsigned long fsfilcnt_t;
#endif /* __fsfilcnt_t_defined */
-#ifndef __uid_t_defined
-#define __uid_t_defined
-typedef unsigned short __uid16_t;
-typedef __uint32_t uid_t;
-#endif /*__uid_t_defined*/
-
-#ifndef __gid_t_defined
-#define __gid_t_defined
-typedef unsigned short __gid16_t;
-typedef __uint32_t gid_t;
-#endif /*__gid_t_defined*/
-
#ifndef __ino_t_defined
#define __ino_t_defined
#ifndef __x86_64__
@@ -113,11 +90,6 @@ struct flock {
pid_t l_pid; /* returned with F_GETLK */
};
-#ifndef __key_t_defined
-#define __key_t_defined
-typedef long long key_t;
-#endif /* __key_t_defined */
-
#ifndef __BIT_TYPES_DEFINED
#define __BIT_TYPES_DEFINED__ 1
diff --git a/winsup/cygwin/include/machine/_types.h b/winsup/cygwin/include/machine/_types.h
new file mode 100644
index 0000000..aafa998
--- /dev/null
+++ b/winsup/cygwin/include/machine/_types.h
@@ -0,0 +1,26 @@
+/* Cygwin's machine/_types.h */
+
+#ifndef _MACHINE__TYPES_H
+#define _MACHINE__TYPES_H
+
+#include <machine/_default_types.h>
+
+#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB)
+typedef __int16_t __dev16_t;
+typedef __uint16_t __uid16_t;
+typedef __uint16_t __gid16_t;
+#endif
+
+#define __dev_t_defined
+typedef __uint32_t __dev_t;
+
+#define __uid_t_defined
+typedef __uint32_t __uid_t;
+
+#define __gid_t_defined
+typedef __uint32_t __gid_t;
+
+#define __key_t_defined
+typedef long long __key_t;
+
+#endif /* _MACHINE__TYPES_H */
diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h
index 8c7128c..e663690 100644
--- a/winsup/cygwin/include/sys/cygwin.h
+++ b/winsup/cygwin/include/sys/cygwin.h
@@ -397,11 +397,9 @@ extern void cygwin_premain3 (int, char **, struct per_process *);
#define EXTERNAL_PINFO_VERSION_32_LP 2
#define EXTERNAL_PINFO_VERSION EXTERNAL_PINFO_VERSION_32_LP
-#ifndef __uid_t_defined
+#ifndef __INSIDE_CYGWIN__
typedef __uint16_t __uid16_t;
typedef __uint16_t __gid16_t;
-typedef __uint32_t uid_t;
-typedef __uint32_t gid_t;
#endif
struct external_pinfo