2022-06-17 10:59:56 -04:00
|
|
|
/*
|
2023-08-09 04:11:54 -04:00
|
|
|
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
2022-06-17 10:59:56 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2020-11-05 23:00:07 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-08-09 04:11:54 -04:00
|
|
|
#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
|
|
|
|
|
2020-11-05 23:00:07 -05:00
|
|
|
#include_next<sys/reent.h>
|
|
|
|
|
2022-07-04 05:53:42 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-08-09 04:11:54 -04:00
|
|
|
#if __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) /* TODO: IDF-8134 */
|
|
|
|
|
2024-02-26 21:00:06 -05:00
|
|
|
extern void __sinit(struct _reent *);
|
2023-08-09 04:11:54 -04:00
|
|
|
|
|
|
|
extern struct _glue __sglue;
|
|
|
|
extern struct _reent * _global_impure_ptr;
|
|
|
|
|
|
|
|
#else /* __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) */
|
|
|
|
|
2020-11-05 23:00:07 -05:00
|
|
|
/* 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.
|
|
|
|
*/
|
2023-08-09 04:11:54 -04:00
|
|
|
extern void _cleanup_r(struct _reent *);
|
|
|
|
|
|
|
|
#endif /* __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) */
|
2022-07-04 05:53:42 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|