public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 2/3] Reentrancy, conditionally provide default __getreent() implementation
@ 2023-08-30  9:16 Pekka Seppänen
  0 siblings, 0 replies; only message in thread
From: Pekka Seppänen @ 2023-08-30  9:16 UTC (permalink / raw)
  To: newlib

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(+)

diff --git a/newlib/libc/reent/getreent.c b/newlib/libc/reent/getreent.c
index 5fa98e96b..86bb04fb9 100644
--- a/newlib/libc/reent/getreent.c
+++ b/newlib/libc/reent/getreent.c
@@ -9,6 +9,8 @@ int _dummy_getreent;
  #include <_ansi.h>
  #include <reent.h>

+#ifndef _REENT_THREAD_LOCAL
+
  #ifdef __getreent
  #undef __getreent
  #endif
@@ -19,4 +21,6 @@ __getreent (void)
    return _impure_ptr;
  }

+#endif /* !_REENT_THREAD_LOCAL */
+
  #endif
-- 
2.34.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-30  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30  9:16 [PATCH 2/3] Reentrancy, conditionally provide default __getreent() implementation Pekka Seppänen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).