From ab9db3a717fe8c960d96a22c9fb1173f68cf5f0c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 28 May 2019 14:29:08 +0200 Subject: [PATCH] LibC: Move size_t, ptrdiff_t and NULL to stddef.h. #POSIX --- LibC/stddef.h | 9 +++++++++ LibC/sys/types.h | 10 ++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/LibC/stddef.h b/LibC/stddef.h index 2e0601bee9..61a20c763a 100644 --- a/LibC/stddef.h +++ b/LibC/stddef.h @@ -2,3 +2,12 @@ #include #include + +#ifdef __cplusplus +#define NULL nullptr +#else +#define NULL ((void*)0) +#endif + +typedef __PTRDIFF_TYPE__ ptrdiff_t; +typedef __SIZE_TYPE__ size_t; diff --git a/LibC/sys/types.h b/LibC/sys/types.h index dc55ad488e..9f806759dc 100644 --- a/LibC/sys/types.h +++ b/LibC/sys/types.h @@ -1,7 +1,8 @@ #pragma once -#include +#include #include +#include __BEGIN_DECLS @@ -14,7 +15,6 @@ typedef uint32_t gid_t; typedef int __pid_t; #define pid_t __pid_t -typedef __SIZE_TYPE__ size_t; typedef int __ssize_t; #define ssize_t __ssize_t @@ -58,11 +58,5 @@ struct utimbuf { time_t modtime; }; -#ifdef __cplusplus -#define NULL nullptr -#else -#define NULL 0 -#endif - __END_DECLS