change(newlib): update newlib according to new internal structures
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -25,6 +25,17 @@ void esp_newlib_time_init(void);
|
||||
*/
|
||||
void esp_reent_init(struct _reent* r);
|
||||
|
||||
/**
|
||||
* Postponed _GLOBAL_REENT stdio FPs initialization.
|
||||
*
|
||||
* Can not be a part of esp_reent_init() because stdio device may not initialized yet.
|
||||
*
|
||||
* Called from startup code and FreeRTOS, not intended to be called from
|
||||
* application code.
|
||||
*
|
||||
*/
|
||||
void esp_newlib_init_global_stdio(const char* stdio_dev);
|
||||
|
||||
/**
|
||||
* Clean up some of lazily allocated buffers in REENT structures.
|
||||
*/
|
||||
|
||||
@@ -1,22 +1,47 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) /* TODO: IDF-8134 */
|
||||
#define _REENT_BACKWARD_BINARY_COMPAT
|
||||
#define _REENT_SDIDINIT(_ptr) ((_ptr)->_reserved_0)
|
||||
#define _REENT_SGLUE(_ptr) (__sglue)
|
||||
#else
|
||||
#define _REENT_CLEANUP(_ptr) ((_ptr)->__cleanup)
|
||||
#define _REENT_STDIN(_ptr) ((_ptr)->_stdin)
|
||||
#define _REENT_STDOUT(_ptr) ((_ptr)->_stdout)
|
||||
#define _REENT_STDERR(_ptr) ((_ptr)->_stderr)
|
||||
#define _REENT_SDIDINIT(_ptr) ((_ptr)->__sdidinit)
|
||||
#define _REENT_SGLUE(_ptr) ((_ptr)->__sglue)
|
||||
#endif
|
||||
|
||||
#include_next<sys/reent.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) /* TODO: IDF-8134 */
|
||||
|
||||
extern void __sinit (struct _reent *);
|
||||
|
||||
extern struct _glue __sglue;
|
||||
extern struct _reent * _global_impure_ptr;
|
||||
|
||||
#else /* __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) */
|
||||
|
||||
/* 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);
|
||||
extern void _cleanup_r(struct _reent *);
|
||||
|
||||
#endif /* __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user