mlibc: M4 support: robustify headers, add sys/signal.h.
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 5 Dec 2017 18:49:37 +0000 (19:49 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 5 Dec 2017 18:49:37 +0000 (19:49 +0100)
* include/errno.h (ERANGE): New define.
* include/stdarg.h (size_t): Undefine before typedef.
* include/stdint.h: Likewise.
* include/stdio.h: Likewise.
* include/stdlib.h: Likewise.
* include/sys/types.h: Likewise.
* include/string.h: Likewise.
  (ssize_t): Undefine before typedef.
* include/unistd.h: Likewise.
  (off_t): Undefine before typedef.
* include/sys/stat.h (struct stat): New stub.
* include/sys/signal.h: New file.

include/errno.h
include/stdarg.h
include/stdint.h
include/stdio.h
include/stdlib.h
include/string.h
include/sys/stat.h
include/sys/types.h
include/unistd.h

index a429d58b3c962fae8796de6c99ac1cc78c450f12..c4ccbb31c1a8e2327f05b8ccd58317903666248f 100644 (file)
@@ -28,6 +28,7 @@
 #include_next <errno.h>
 #else // ! (__GNUC__ && POSIX)
 int errno;
+#define        ERANGE          34      /* Math result not representable */
 #endif // ! (__GNUC__ && POSIX)
 
 #endif // __MES_ERRNO_H
index 211ec36f2e63e402bf073f316af295b79ea42f7f..d93befa70b1512a52026599469763ef9a9638609 100644 (file)
@@ -27,6 +27,7 @@
 
 #ifndef __MES_SIZE_T
 #define __MES_SIZE_T
+#undef size_t
 typedef unsigned long size_t;
 #endif
 
index 28f6b7442d5d1e971549f13e88ce7ca02b0b8c05..63cf9ce119ad27eee57f32da346ce22e4643d587 100644 (file)
@@ -40,6 +40,7 @@ typedef long long int64_t;
 
 #ifndef __MES_SIZE_T
 #define __MES_SIZE_T
+#undef size_t
 typedef unsigned long size_t;
 #endif
 
index 0bb24341bf0aaa2a9285bc3efb8713aeeed42af2..4372f970d89d07b39bca2dbd526ee2984fa68312 100644 (file)
@@ -94,6 +94,7 @@ typedef int FILE;
 
 #ifndef __MES_SIZE_T
 #define __MES_SIZE_T
+#undef size_t
 typedef unsigned long size_t;
 #endif
 
index cb9f0a8c4bff731de07df5f5161129389c817577..651fb0eeab32e6998f21485e7ad9fb95222e5323 100644 (file)
@@ -30,7 +30,8 @@
 
 #ifndef __MES_SIZE_T
 #define __MES_SIZE_T
-typedef long size_t;
+#undef size_t
+typedef unsigned long size_t;
 #endif
 
 int atoi (char const *s);
index 9a1e13446c6e1a447dff941e0a9acb06fb7cbf8f..aa8239df605d23c554b3292994b1f5c9f3c5e5d4 100644 (file)
 
 #ifndef __MES_SIZE_T
 #define __MES_SIZE_T
+#undef size_t
 typedef unsigned long size_t;
 #endif
 
 #ifndef __MES_SSIZE_T
 #define __MES_SSIZE_T
+#undef ssize_t
 typedef long ssize_t;
 #endif
 
index 22ae82625c9df8d12b5f451b7fcf2c035d8492a7..52ff8d06d02156954a6fa957656d98f9805fdd62 100644 (file)
 #include_next <sys/stat.h>
 #endif // (__GNUC__ && POSIX)
 
+struct stat {
+  int st_dev;
+  int st_ino;
+  int st_mode;
+  int st_nlink;
+  int st_uid;
+  int st_gid;
+  int st_rdev;
+  int st_size;
+  int st_blksize;
+  int st_blocks;
+  int st_atime;
+  int st_mtime;
+  int st_ctime;
+};
+
 #endif // __MES_SYS_STAT_H
 
index 4e00b73e1a08893aac772fb584aa397a6ffd2b56..18590c1aefe686cf5110aee76e5f28c860af0524 100644 (file)
 #include_next <sys/types.h>
 #else // ! (__GNUC__ && POSIX)
 #include <endian.h>
+
+#ifndef __MES_SIZE_T
+#define __MES_SIZE_T
+#undef size_t
+typedef unsigned long size_t;
+#endif
+
 #endif // ! (__GNUC__ && POSIX)
 
 #endif // __MES_SYS_TYPES_H
index 89f7ad70ad039e0cce168582122d3e0990c3ff63..42852be8dd267fb7ea629b68cc0430cb43b53e54 100644 (file)
 
 #ifndef __MES_OFF_T
 #define __MES_OFF_T
+#undef off_t
 typedef unsigned long off_t;
 #endif
 
 #ifndef __MES_SIZE_T
 #define __MES_SIZE_T
+#undef size_t
 typedef unsigned long size_t;
 #endif
 
 #ifndef __MES_SSIZE_T
 #define __MES_SSIZE_T
+#undef ssize_t
 typedef long ssize_t;
 #endif