diff --git a/components/newlib/platform_include/endian.h b/components/newlib/platform_include/endian.h index f4f825c406..67131ff4c1 100644 --- a/components/newlib/platform_include/endian.h +++ b/components/newlib/platform_include/endian.h @@ -50,6 +50,10 @@ */ #include +#ifdef __cplusplus +extern "C" { +#endif + /* * General byte order swapping functions. */ @@ -198,3 +202,7 @@ le64enc(void *pp, uint64_t u) le32enc(p, (uint32_t)(u & 0xffffffffU)); le32enc(p + 4, (uint32_t)(u >> 32)); } + +#ifdef __cplusplus +} +#endif diff --git a/components/newlib/platform_include/esp_newlib.h b/components/newlib/platform_include/esp_newlib.h index a2a0e3c729..7912100b51 100644 --- a/components/newlib/platform_include/esp_newlib.h +++ b/components/newlib/platform_include/esp_newlib.h @@ -4,11 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef __ESP_NEWLIB_H__ -#define __ESP_NEWLIB_H__ +#pragma once #include +#ifdef __cplusplus +extern "C" { +#endif + /* * Initialize newlib time functions */ @@ -57,4 +60,6 @@ void esp_sync_timekeeping_timers(void); */ void esp_newlib_locks_init(void); -#endif //__ESP_NEWLIB_H__ +#ifdef __cplusplus +} +#endif diff --git a/components/newlib/platform_include/sys/reent.h b/components/newlib/platform_include/sys/reent.h index 65ac66413e..845f66161e 100644 --- a/components/newlib/platform_include/sys/reent.h +++ b/components/newlib/platform_include/sys/reent.h @@ -8,8 +8,16 @@ #include_next +#ifdef __cplusplus +extern "C" { +#endif + /* This function is not part of the newlib API, it is defined in libc/stdio/local.h * There is no nice way to get __cleanup member populated while avoiding __sinit, * so extern declaration is used here. */ extern void _cleanup_r(struct _reent* r); + +#ifdef __cplusplus +} +#endif diff --git a/components/newlib/platform_include/sys/un.h b/components/newlib/platform_include/sys/un.h index 4b5ab2177b..213b0ab4fd 100644 --- a/components/newlib/platform_include/sys/un.h +++ b/components/newlib/platform_include/sys/un.h @@ -3,8 +3,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#ifndef _ESP_PLATFORM_SYS_UN_H_ -#define _ESP_PLATFORM_SYS_UN_H_ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif #define AF_UNIX 1 /* local to host (pipes) */ @@ -13,4 +16,6 @@ struct sockaddr_un { char sun_path[108]; /*path name */ }; -#endif // _ESP_PLATFORM_SYS_UN_H_ +#ifdef __cplusplus +} +#endif diff --git a/components/newlib/platform_include/sys/unistd.h b/components/newlib/platform_include/sys/unistd.h index 3986867718..0cb4a14db7 100644 --- a/components/newlib/platform_include/sys/unistd.h +++ b/components/newlib/platform_include/sys/unistd.h @@ -4,20 +4,19 @@ * SPDX-License-Identifier: Apache-2.0 */ +#pragma once -#ifndef _ESP_SYS_UNISTD_H -#define _ESP_SYS_UNISTD_H +#include + +#include_next #ifdef __cplusplus extern "C" { #endif -#include_next - int truncate(const char *, off_t __length); int gethostname(char *__name, size_t __len); #ifdef __cplusplus } #endif -#endif /* _SYS_UNISTD_H */ diff --git a/components/newlib/platform_include/time.h b/components/newlib/platform_include/time.h index 30a71edf5f..b79b5f36ff 100644 --- a/components/newlib/platform_include/time.h +++ b/components/newlib/platform_include/time.h @@ -4,14 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ +#pragma once -#ifndef _ESP_TIME_H -#define _ESP_TIME_H +#include + +#include_next #ifdef __cplusplus extern "C" { #endif -#include_next #define _POSIX_TIMERS 1 #ifndef CLOCK_MONOTONIC @@ -28,4 +29,3 @@ int clock_getres(clockid_t clock_id, struct timespec *res); #ifdef __cplusplus } #endif -#endif /* _ESP_TIME_H */ diff --git a/tools/ci/check_copyright_config.yaml b/tools/ci/check_copyright_config.yaml index c94bf5fb00..b9c6e19272 100644 --- a/tools/ci/check_copyright_config.yaml +++ b/tools/ci/check_copyright_config.yaml @@ -67,6 +67,14 @@ lwip_component: - BSD-3-Clause license_for_new_files: Apache-2.0 +newlib_component: + include: + - 'components/newlib/**' + allowed_licenses: + - Apache-2.0 + - BSD-2-Clause-FreeBSD AND Apache-2.0 + license_for_new_files: Apache-2.0 + asio_component: include: - 'components/asio/port/**' diff --git a/tools/ci/check_public_headers_exceptions.txt b/tools/ci/check_public_headers_exceptions.txt index 5225a469b6..669b0c1b29 100644 --- a/tools/ci/check_public_headers_exceptions.txt +++ b/tools/ci/check_public_headers_exceptions.txt @@ -7,7 +7,6 @@ components/xtensa/esp32s2/include/xtensa/config/ components/xtensa/esp32s3/include/xtensa/config/ -components/newlib/platform_include/ components/freertos/esp_additions/include/freertos_tasks_c_additions.h components/freertos/FreeRTOS-Kernel/include/freertos/