Commit d45c323a authored by Bence Szépkúti's avatar Bence Szépkúti
Browse files

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: default avatarBence Szépkúti <bence.szepkuti@arm.com>
Change-Id: Iecfbad2cf360cfb705ce7aaa981700fd16219b82
parent b382ac68
/*
* 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_
......
/*
* 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 */
/*
* 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 */
/*
* 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 */
/*
* 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_
......
/*
* 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 */
/*
* 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 */
/*
* 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 */
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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 */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment