From c53fe299c0280d51e2aea0d8f37f55925bed433e Mon Sep 17 00:00:00 2001 From: Qiu Peiyang Date: Tue, 13 Sep 2016 10:19:07 +0800 Subject: [PATCH] libc: replace null.h and size_t.h with stddef.h According to commit b71a8a4591 and Jira: ZEP-733 (libc: remove stddef.h which is provided by the compiler), the stddef.h in zephyr code is removed and it's provided by the compiler. The original stddef.h includes two head files, null.h and size_t.h, which are also useless now. So remove these two deprecated files, in case conflicting definition. Change-Id: Ie7163fdbd23c32759425b50f3deff2a57cc051a9 Signed-off-by: Qiu Peiyang --- lib/libc/minimal/include/bits/null.h | 28 ------------------- lib/libc/minimal/include/bits/size_t.h | 37 -------------------------- lib/libc/minimal/include/stdio.h | 3 +-- lib/libc/minimal/include/stdlib.h | 4 +-- lib/libc/minimal/include/string.h | 3 +-- 5 files changed, 3 insertions(+), 72 deletions(-) delete mode 100644 lib/libc/minimal/include/bits/null.h delete mode 100644 lib/libc/minimal/include/bits/size_t.h diff --git a/lib/libc/minimal/include/bits/null.h b/lib/libc/minimal/include/bits/null.h deleted file mode 100644 index 55d65ff7044..00000000000 --- a/lib/libc/minimal/include/bits/null.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2016 Wind River Systems, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * @brief NULL definition - */ - -#if !defined(NULL) -#ifdef __cplusplus - #define NULL 0 -#else - #define NULL (void *)0 -#endif -#endif diff --git a/lib/libc/minimal/include/bits/size_t.h b/lib/libc/minimal/include/bits/size_t.h deleted file mode 100644 index 0ac252588b8..00000000000 --- a/lib/libc/minimal/include/bits/size_t.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2016 Wind River Systems, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * @brief size_t definition - */ - -#if !defined(__size_t_defined) -#define __size_t_defined - -#ifdef __i386 -typedef unsigned long int size_t; -#elif defined(__ARM_ARCH) -typedef unsigned int size_t; -#elif defined(__arc__) -typedef unsigned int size_t; -#elif defined(__NIOS2__) -typedef unsigned int size_t; -#else -#error "The minimal libc library does not recognize the architecture!\n" -#endif - -#endif diff --git a/lib/libc/minimal/include/stdio.h b/lib/libc/minimal/include/stdio.h index 5cf10b6986a..48f78db6d77 100644 --- a/lib/libc/minimal/include/stdio.h +++ b/lib/libc/minimal/include/stdio.h @@ -20,9 +20,8 @@ #define __INC_stdio_h__ #include /* Needed to get definition of va_list */ -#include -#include #include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/libc/minimal/include/stdlib.h b/lib/libc/minimal/include/stdlib.h index 43932053ac5..4657258429b 100644 --- a/lib/libc/minimal/include/stdlib.h +++ b/lib/libc/minimal/include/stdlib.h @@ -19,9 +19,7 @@ #ifndef __INC_stdlib_h__ #define __INC_stdlib_h__ -#include -#include - +#include #ifdef __cplusplus extern "C" { #endif diff --git a/lib/libc/minimal/include/string.h b/lib/libc/minimal/include/string.h index 8e98dd4c255..0b97c0fe39c 100644 --- a/lib/libc/minimal/include/string.h +++ b/lib/libc/minimal/include/string.h @@ -19,8 +19,7 @@ #ifndef __INC_string_h__ #define __INC_string_h__ -#include -#include +#include #include #ifdef __cplusplus