From 6e59f9e8be0e1186c25aa3520137a65ca3be77de Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Thu, 30 Sep 2021 10:44:49 +0800 Subject: [PATCH] [newlib]: Added missing includes Closes https://github.com/espressif/esp-idf/issues/7498 --- components/newlib/platform_include/endian.h | 42 +++++++------------- components/newlib/platform_include/sys/uio.h | 35 ++++++++-------- tools/ci/check_copyright_ignore.txt | 2 - 3 files changed, 34 insertions(+), 45 deletions(-) diff --git a/components/newlib/platform_include/endian.h b/components/newlib/platform_include/endian.h index c5b0a3c713..f4f825c406 100644 --- a/components/newlib/platform_include/endian.h +++ b/components/newlib/platform_include/endian.h @@ -1,28 +1,3 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// Copyright 2020 Francesco Giancane -// -// 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. - -/* - * This is a compatibility header for . - * In xtensa-newlib distribution it is located in - * but most program expect to be plain . - */ - -#ifndef XTENSA_COMPAT_ENDIAN_H_INCLUDED -#define XTENSA_COMPAT_ENDIAN_H_INCLUDED -#include - /* * All the code below is a rework of * https://github.com/freebsd/freebsd/blob/master/sys/sys/endian.h @@ -32,7 +7,10 @@ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020 Francesco Giancane + * SPDX-FileCopyrightText: 2002 Thomas Moestl + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND Apache-2.0 * * Copyright (c) 2002 Thomas Moestl * All rights reserved. @@ -61,6 +39,17 @@ * $FreeBSD$ */ +#pragma once + +#include + +/* + * This is a compatibility header for . + * In xtensa-newlib distribution it is located in + * but most program expect to be plain . + */ +#include + /* * General byte order swapping functions. */ @@ -209,4 +198,3 @@ le64enc(void *pp, uint64_t u) le32enc(p, (uint32_t)(u & 0xffffffffU)); le32enc(p + 4, (uint32_t)(u >> 32)); } -#endif /* XTENSA_COMPAT_ENDIAN_H_INCLUDED */ diff --git a/components/newlib/platform_include/sys/uio.h b/components/newlib/platform_include/sys/uio.h index ede27b2351..3ff3eba871 100644 --- a/components/newlib/platform_include/sys/uio.h +++ b/components/newlib/platform_include/sys/uio.h @@ -1,21 +1,24 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// 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. -#ifndef _ESP_PLATFORM_SYS_UIO_H_ -#define _ESP_PLATFORM_SYS_UIO_H_ +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct iovec; int writev(int s, const struct iovec *iov, int iovcnt); ssize_t readv(int fd, const struct iovec *iov, int iovcnt); -#endif // _ESP_PLATFORM_SYS_UIO_H_ +#ifdef __cplusplus +} +#endif diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 1280cb7471..b6eb52051a 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -1974,7 +1974,6 @@ components/newlib/heap.c components/newlib/locks.c components/newlib/newlib_init.c components/newlib/platform_include/assert.h -components/newlib/platform_include/endian.h components/newlib/platform_include/errno.h components/newlib/platform_include/esp_newlib.h components/newlib/platform_include/net/if.h @@ -1988,7 +1987,6 @@ components/newlib/platform_include/sys/reent.h components/newlib/platform_include/sys/select.h components/newlib/platform_include/sys/termios.h components/newlib/platform_include/sys/time.h -components/newlib/platform_include/sys/uio.h components/newlib/platform_include/sys/un.h components/newlib/platform_include/sys/unistd.h components/newlib/platform_include/sys/utime.h