mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
newlib: Fix header issues with C++ guards and implicit inclusion
* Added C++ sentinels if missed * Used #pragma once, removed macro's with leading underscores * Updated copyright checker to allow "BSD-2-Clause-FreeBSD AND Apache-2.0" for newlib files * Fixed minor compilation issues/implicit inclusions
This commit is contained in:
@@ -8,8 +8,16 @@
|
||||
|
||||
#include_next<sys/reent.h>
|
||||
|
||||
#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
|
||||
|
@@ -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
|
||||
|
@@ -4,20 +4,19 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef _ESP_SYS_UNISTD_H
|
||||
#define _ESP_SYS_UNISTD_H
|
||||
#include <sys/types.h>
|
||||
|
||||
#include_next <sys/unistd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include_next <sys/unistd.h>
|
||||
|
||||
int truncate(const char *, off_t __length);
|
||||
int gethostname(char *__name, size_t __len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _SYS_UNISTD_H */
|
||||
|
Reference in New Issue
Block a user