[PATCH 2/2] Add BSD guards for off_t, dev_t, uid_t, and gid_t
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Apr 12 08:50:14 UTC 2016
Copy definitions of off_t, dev_t, uid_t, and gid_t verbatim from latest
FreeBSD <sys/types.h>.
Signed-off-by: Sebastian Huber <sebastian.huber at embedded-brains.de>
---
newlib/libc/include/sys/types.h | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index c0b5796..496c2ae 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -168,11 +168,23 @@ typedef int32_t register_t;
*/
#ifndef __CYGWIN__ /* which defines these types in it's own types.h. */
-typedef _off_t off_t;
-typedef __dev_t dev_t;
-typedef __uid_t uid_t;
-typedef __gid_t gid_t;
+#ifndef _OFF_T_DECLARED
+typedef __off_t off_t; /* file offset */
+#define _OFF_T_DECLARED
#endif
+#ifndef _DEV_T_DECLARED
+typedef __dev_t dev_t; /* device number or struct cdev */
+#define _DEV_T_DECLARED
+#endif
+#ifndef _UID_T_DECLARED
+typedef __uid_t uid_t; /* user id */
+#define _UID_T_DECLARED
+#endif
+#ifndef _GID_T_DECLARED
+typedef __gid_t gid_t; /* group id */
+#define _GID_T_DECLARED
+#endif
+#endif /* !__CYGWIN__ */
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t; /* process id */
--
1.8.4.5
More information about the devel
mailing list