[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v2 4/6] lib/nolibc: Don't include std*.h in another std*.h



Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 17.08.2018 09:56, Florian Schmidt wrote:
And deal with the fallout of that.

Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
---
  lib/nolibc/include/stdint.h | 1 -
  lib/nolibc/include/stdio.h  | 1 +
  lib/nolibc/include/stdlib.h | 4 +++-
  lib/nolibc/include/string.h | 7 ++++---
  lib/nolibc/include/unistd.h | 1 +
  lib/nolibc/stdio.c          | 1 +
  lib/nolibc/stdlib.c         | 1 +
  plat/xen/x86/arch_time.c    | 1 +
  8 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/lib/nolibc/include/stdint.h b/lib/nolibc/include/stdint.h
index 3914934..945a75d 100644
--- a/lib/nolibc/include/stdint.h
+++ b/lib/nolibc/include/stdint.h
@@ -36,7 +36,6 @@
  #ifndef __STDINT_H__
  #define __STDINT_H__
-#include <stddef.h>
  #include <uk/arch/types.h>
#ifdef __cplusplus
diff --git a/lib/nolibc/include/stdio.h b/lib/nolibc/include/stdio.h
index 574756c..b451ad2 100644
--- a/lib/nolibc/include/stdio.h
+++ b/lib/nolibc/include/stdio.h
@@ -44,6 +44,7 @@ extern "C" {
#define __NEED_NULL
  #define __NEED_size_t
+#define __NEED_ssize_t
  #include <nolibc-internal/shareddefs.h>
struct _nolibc_fd;
diff --git a/lib/nolibc/include/stdlib.h b/lib/nolibc/include/stdlib.h
index f2a0ccf..247a3f8 100644
--- a/lib/nolibc/include/stdlib.h
+++ b/lib/nolibc/include/stdlib.h
@@ -27,13 +27,15 @@
  #ifndef __STDLIB_H__
  #define __STDLIB_H__
-#include <stdint.h>
  #include <uk/config.h>
#ifdef __cplusplus
  extern "C" {
  #endif
+#define __NEED_NULL
+#define __NEED_size_t
+#include <nolibc-internal/shareddefs.h>
/**
   * Convert a string to an unsigned long integer.
diff --git a/lib/nolibc/include/string.h b/lib/nolibc/include/string.h
index 4d12a5a..677f528 100644
--- a/lib/nolibc/include/string.h
+++ b/lib/nolibc/include/string.h
@@ -36,13 +36,14 @@
  #ifndef __STRING_H__
  #define __STRING_H__
-#include <sys/types.h>
-#include <stddef.h>
-
  #ifdef __cplusplus
  extern "C" {
  #endif
+#define __NEED_NULL
+#define __NEED_size_t
+#include <nolibc-internal/shareddefs.h>
+
  void *memcpy(void *dst, const void *src, size_t len);
  void *memset(void *ptr, int val, size_t len);
  void *memchr(const void *ptr, int val, size_t len);
diff --git a/lib/nolibc/include/unistd.h b/lib/nolibc/include/unistd.h
index dadfd4a..6705994 100644
--- a/lib/nolibc/include/unistd.h
+++ b/lib/nolibc/include/unistd.h
@@ -42,6 +42,7 @@ extern "C" {
  #endif
#define __NEED_NULL
+#define __NEED_size_t
  #define __NEED_ssize_t
  #include <nolibc-internal/shareddefs.h>
diff --git a/lib/nolibc/stdio.c b/lib/nolibc/stdio.c
index 7e3d368..e896dd3 100644
--- a/lib/nolibc/stdio.c
+++ b/lib/nolibc/stdio.c
@@ -51,6 +51,7 @@
   * SUCH DAMAGE.
   */
+#include <stddef.h>
  #include <stdlib.h>
  #include <inttypes.h>
  #include <limits.h>
diff --git a/lib/nolibc/stdlib.c b/lib/nolibc/stdlib.c
index 22afa77..d3c94e1 100644
--- a/lib/nolibc/stdlib.c
+++ b/lib/nolibc/stdlib.c
@@ -51,6 +51,7 @@
   * SUCH DAMAGE.
   */
+#include <stdint.h>
  #include <stdlib.h>
  #include <limits.h>
  #include <ctype.h>
diff --git a/plat/xen/x86/arch_time.c b/plat/xen/x86/arch_time.c
index 702f786..f96426f 100644
--- a/plat/xen/x86/arch_time.c
+++ b/plat/xen/x86/arch_time.c
@@ -33,6 +33,7 @@
   * DEALINGS IN THE SOFTWARE.
   */
+#include <stddef.h>
  #include <stdint.h>
  #include <sys/time.h>
  #include <uk/plat/time.h>


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.