2022-06-17 14:59:56 +00:00
|
|
|
/*
|
2023-08-09 08:11:54 +00:00
|
|
|
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
2022-06-17 14:59:56 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2020-11-06 04:00:07 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-08-09 08:11:54 +00: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-06 04:00:07 +00:00
|
|
|
#include_next<sys/reent.h>
|
|
|
|
|
2023-08-09 08:11:54 +00:00
|
|
|
|
2022-07-04 09:53:42 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-08-09 08:11:54 +00:00
|
|
|
#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 ) */
|
|
|
|
|
2020-11-06 04:00:07 +00: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 08:11:54 +00:00
|
|
|
extern void _cleanup_r(struct _reent *);
|
|
|
|
|
|
|
|
#endif /* __NEWLIB__ > 4 || ( __NEWLIB__ == 4 && __NEWLIB_MINOR__ > 1 ) */
|
2022-07-04 09:53:42 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|