From 7a1c717c8bba1d046c37c75c3d8c110aeba3cc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Sepp=C3=A4nen?= Date: Wed, 30 Aug 2023 12:16:32 +0300 Subject: Reentrancy, conditionally provide default __getreent() implementation Conditionally provide default __getreent() implementation only if _REENT_THREAD_LOCAL is not defined. If struct _reent is replaced by dedicated thread-local objects neither the structure nor _impure_ptr is available. --- newlib/libc/reent/getreent.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'newlib/libc') diff --git a/newlib/libc/reent/getreent.c b/newlib/libc/reent/getreent.c index 5fa98e9..86bb04f 100644 --- a/newlib/libc/reent/getreent.c +++ b/newlib/libc/reent/getreent.c @@ -9,6 +9,8 @@ int _dummy_getreent; #include <_ansi.h> #include +#ifndef _REENT_THREAD_LOCAL + #ifdef __getreent #undef __getreent #endif @@ -19,4 +21,6 @@ __getreent (void) return _impure_ptr; } +#endif /* !_REENT_THREAD_LOCAL */ + #endif -- cgit v1.1