diff options
author | Bence Szépkúti <bence.szepkuti@arm.com> | 2019-10-25 18:12:41 +0200 |
---|---|---|
committer | Bence Szépkúti <bence.szepkuti@arm.com> | 2019-12-06 11:37:19 +0100 |
commit | d45c323a9c34404cbec5711acc9ba2dced8e1ba7 (patch) | |
tree | 6dc7fad3da6b516639d3836a87265c12dfac6a6c /include/lib | |
parent | b382ac6887b864ff4252022cbeb13f0405daff79 (diff) | |
download | platform_external_arm-trusted-firmware-d45c323a9c34404cbec5711acc9ba2dced8e1ba7.tar.gz platform_external_arm-trusted-firmware-d45c323a9c34404cbec5711acc9ba2dced8e1ba7.tar.bz2 platform_external_arm-trusted-firmware-d45c323a9c34404cbec5711acc9ba2dced8e1ba7.zip |
libc: Consolidate the size_t and NULL definitions
Consolidate the definition of size_t to one header per AArch, and
the definition of NULL to one header
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Change-Id: Iecfbad2cf360cfb705ce7aaa981700fd16219b82
Diffstat (limited to 'include/lib')
-rw-r--r-- | include/lib/libc/aarch32/stdio_.h | 7 | ||||
-rw-r--r-- | include/lib/libc/aarch32/stdlib_.h | 15 | ||||
-rw-r--r-- | include/lib/libc/aarch32/string_.h | 15 | ||||
-rw-r--r-- | include/lib/libc/aarch32/time_.h | 15 | ||||
-rw-r--r-- | include/lib/libc/aarch64/stdio_.h | 7 | ||||
-rw-r--r-- | include/lib/libc/aarch64/stdlib_.h | 15 | ||||
-rw-r--r-- | include/lib/libc/aarch64/string_.h | 15 | ||||
-rw-r--r-- | include/lib/libc/aarch64/time_.h | 15 | ||||
-rw-r--r-- | include/lib/libc/stdio.h | 7 | ||||
-rw-r--r-- | include/lib/libc/stdlib.h | 6 | ||||
-rw-r--r-- | include/lib/libc/string.h | 8 | ||||
-rw-r--r-- | include/lib/libc/time.h | 6 |
12 files changed, 8 insertions, 123 deletions
diff --git a/include/lib/libc/aarch32/stdio_.h b/include/lib/libc/aarch32/stdio_.h index 50d3cc2ed..5e49425cb 100644 --- a/include/lib/libc/aarch32/stdio_.h +++ b/include/lib/libc/aarch32/stdio_.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -7,11 +7,6 @@ #ifndef STDIO__H #define STDIO__H -#ifndef SIZET_ -typedef unsigned int size_t; -#define SIZET_ -#endif - #ifndef SSIZET_ typedef int ssize_t; #define SSIZET_ diff --git a/include/lib/libc/aarch32/stdlib_.h b/include/lib/libc/aarch32/stdlib_.h deleted file mode 100644 index ff53b6f92..000000000 --- a/include/lib/libc/aarch32/stdlib_.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef STDLIB__H -#define STDLIB__H - -#ifndef SIZET_ -typedef unsigned int size_t; -#define SIZET_ -#endif - -#endif /* STDLIB__H */ diff --git a/include/lib/libc/aarch32/string_.h b/include/lib/libc/aarch32/string_.h deleted file mode 100644 index 4e139b0db..000000000 --- a/include/lib/libc/aarch32/string_.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef STRING__H -#define STRING__H - -#ifndef SIZET_ -typedef unsigned int size_t; -#define SIZET_ -#endif - -#endif /* STRING__H */ diff --git a/include/lib/libc/aarch32/time_.h b/include/lib/libc/aarch32/time_.h deleted file mode 100644 index cfd487dc6..000000000 --- a/include/lib/libc/aarch32/time_.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef TIME__H -#define TIME__H - -#ifndef SIZET_ -typedef unsigned int size_t; -#define SIZET_ -#endif - -#endif /* TIME__H */ diff --git a/include/lib/libc/aarch64/stdio_.h b/include/lib/libc/aarch64/stdio_.h index 09b0172dd..afaeadc21 100644 --- a/include/lib/libc/aarch64/stdio_.h +++ b/include/lib/libc/aarch64/stdio_.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -7,11 +7,6 @@ #ifndef STDIO__H #define STDIO__H -#ifndef SIZET_ -typedef unsigned long size_t; -#define SIZET_ -#endif - #ifndef SSIZET_ typedef long ssize_t; #define SSIZET_ diff --git a/include/lib/libc/aarch64/stdlib_.h b/include/lib/libc/aarch64/stdlib_.h deleted file mode 100644 index 531308a2e..000000000 --- a/include/lib/libc/aarch64/stdlib_.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef STDLIB__H -#define STDLIB__H - -#ifndef SIZET_ -typedef unsigned long size_t; -#define SIZET_ -#endif - -#endif /* STDLIB__H */ diff --git a/include/lib/libc/aarch64/string_.h b/include/lib/libc/aarch64/string_.h deleted file mode 100644 index 71c51a6cd..000000000 --- a/include/lib/libc/aarch64/string_.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef STRING__H -#define STRING__H - -#ifndef SIZET_ -typedef unsigned long size_t; -#define SIZET_ -#endif - -#endif /* STRING__H */ diff --git a/include/lib/libc/aarch64/time_.h b/include/lib/libc/aarch64/time_.h deleted file mode 100644 index 8b298a39d..000000000 --- a/include/lib/libc/aarch64/time_.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef TIME__H -#define TIME__H - -#ifndef SIZET_ -typedef unsigned long size_t; -#define SIZET_ -#endif - -#endif /* TIME__H */ diff --git a/include/lib/libc/stdio.h b/include/lib/libc/stdio.h index 3d9323efa..2d9e6557b 100644 --- a/include/lib/libc/stdio.h +++ b/include/lib/libc/stdio.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ /* - * Portions copyright (c) 2018, ARM Limited and Contributors. + * Portions copyright (c) 2018-2019, ARM Limited and Contributors. * All rights reserved. */ @@ -12,12 +12,9 @@ #define STDIO_H #include <cdefs.h> +#include <stddef.h> #include <stdio_.h> -#ifndef NULL -#define NULL ((void *) 0) -#endif - #define EOF -1 int printf(const char *fmt, ...) __printflike(1, 2); diff --git a/include/lib/libc/stdlib.h b/include/lib/libc/stdlib.h index 84ba37f9a..24e7bae2f 100644 --- a/include/lib/libc/stdlib.h +++ b/include/lib/libc/stdlib.h @@ -11,15 +11,11 @@ #ifndef STDLIB_H #define STDLIB_H -#include <stdlib_.h> +#include <stddef.h> #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 -#ifndef NULL -#define NULL ((void *) 0) -#endif - #define _ATEXIT_MAX 1 extern void abort(void); diff --git a/include/lib/libc/string.h b/include/lib/libc/string.h index ee6eeacef..c92b6808c 100644 --- a/include/lib/libc/string.h +++ b/include/lib/libc/string.h @@ -4,18 +4,14 @@ * SPDX-License-Identifier: BSD-3-Clause */ /* - * Portions copyright (c) 2018, ARM Limited and Contributors. + * Portions copyright (c) 2018-2019, ARM Limited and Contributors. * All rights reserved. */ #ifndef STRING_H #define STRING_H -#include <string_.h> - -#ifndef NULL -#define NULL ((void *) 0) -#endif +#include <stddef.h> void *memcpy(void *dst, const void *src, size_t len); void *memmove(void *dst, const void *src, size_t len); diff --git a/include/lib/libc/time.h b/include/lib/libc/time.h index 714884b05..c1c95e586 100644 --- a/include/lib/libc/time.h +++ b/include/lib/libc/time.h @@ -11,12 +11,8 @@ #ifndef TIME_H #define TIME_H -#include <time_.h> +#include <stddef.h> typedef long int time_t; -#ifndef NULL -#define NULL ((void *) 0) -#endif - #endif /* TIME_H */ |