[PATCH v2 03/18] Add BSD guard for ino_t in <sys/types.h>
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Apr 15 11:44:14 UTC 2016
Introduce internal type __ino_t.
Signed-off-by: Sebastian Huber <sebastian.huber at embedded-brains.de>
---
newlib/libc/include/sys/_types.h | 9 +++++++++
newlib/libc/include/sys/types.h | 10 +++-------
newlib/libc/sys/rtems/include/machine/_types.h | 3 +++
winsup/cygwin/include/cygwin/types.h | 8 --------
winsup/cygwin/include/machine/_types.h | 4 ++++
5 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index ce1aa70..869c6a2 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -47,6 +47,15 @@ typedef unsigned short __gid_t;
typedef __uint32_t __id_t;
#endif
+#ifndef __machine_ino_t_defined
+#if (defined(__i386__) && (defined(GO32) || defined(__MSDOS__))) || \
+ defined(__sparc__) || defined(__SPU__)
+typedef unsigned long __ino_t;
+#else
+typedef unsigned short __ino_t;
+#endif
+#endif
+
#ifndef __machine_off64_t_defined
__extension__ typedef long long _off64_t;
#endif
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index d093578..2bf9eb5 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -139,14 +139,10 @@ typedef __id_t id_t; /* can hold a uid_t or pid_t */
#define _ID_T_DECLARED
#endif
-#ifndef __CYGWIN__
-#if defined(__MS_types__) || defined(__rtems__) || \
- defined(__sparc__) || defined(__SPU__)
-typedef unsigned long ino_t;
-#else
-typedef unsigned short ino_t;
+#ifndef _INO_T_DECLARED
+typedef __ino_t ino_t; /* inode number */
+#define _INO_T_DECLARED
#endif
-#endif /*__CYGWIN__*/
#ifdef __MS_types__
typedef unsigned long vm_offset_t;
diff --git a/newlib/libc/sys/rtems/include/machine/_types.h b/newlib/libc/sys/rtems/include/machine/_types.h
index f17d281..76a6841 100644
--- a/newlib/libc/sys/rtems/include/machine/_types.h
+++ b/newlib/libc/sys/rtems/include/machine/_types.h
@@ -19,6 +19,9 @@ typedef __int32_t _off_t;
typedef _off_t _fpos_t;
#define __machine_fpos_t_defined
+typedef unsigned long __ino_t;
+#define __machine_ino_t_defined
+
typedef __uint32_t _mode_t;
#define __machine_mode_t_defined
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index bfffc5d..c785fb2 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -57,14 +57,6 @@ typedef unsigned long fsblkcnt_t;
typedef unsigned long fsfilcnt_t;
#endif /* __fsfilcnt_t_defined */
-#ifndef __ino_t_defined
-#define __ino_t_defined
-#ifndef __x86_64__
-typedef __uint32_t __ino32_t;
-#endif
-typedef __uint64_t ino_t;
-#endif /*__ino_t_defined*/
-
#if defined (__INSIDE_CYGWIN__) && !defined (__x86_64__)
struct __flock32 {
short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
diff --git a/winsup/cygwin/include/machine/_types.h b/winsup/cygwin/include/machine/_types.h
index 50e704b..fa69526 100644
--- a/winsup/cygwin/include/machine/_types.h
+++ b/winsup/cygwin/include/machine/_types.h
@@ -9,6 +9,7 @@
typedef __int16_t __dev16_t;
typedef __uint16_t __uid16_t;
typedef __uint16_t __gid16_t;
+typedef __uint32_t __ino32_t;
#endif
#define __machine_dev_t_defined
@@ -20,6 +21,9 @@ typedef __uint32_t __uid_t;
#define __machine_gid_t_defined
typedef __uint32_t __gid_t;
+#define __machine_ino_t_defined
+typedef __uint64_t __ino_t;
+
#define __machine_key_t_defined
typedef long long __key_t;
--
1.8.4.5
More information about the devel
mailing list