Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include/sys/reent.h')
-rw-r--r--newlib/libc/include/sys/reent.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 5303ed3dd..1edfad696 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -607,7 +607,14 @@ void _reclaim_reent _PARAMS ((struct _reent *));
/* #define _REENT_ONLY define this to get only reentrant routines */
#ifndef _REENT_ONLY
-#define _REENT _impure_ptr
+
+#if defined(__DYNAMIC_REENT__) && !defined(__SINGLE_THREAD__)
+ struct _reent * _EXFUN(__getreent, (void));
+# define _REENT (__getreent())
+#else /* __SINGLE_THREAD__ || !__DYNAMIC_REENT__ */
+# define _REENT _impure_ptr
+#endif /* __SINGLE_THREAD__ || !__DYNAMIC_REENT__ */
+
#endif /* !_REENT_ONLY */
#ifdef __cplusplus