summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/local.h
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/local.h')
-rw-r--r--newlib/libc/stdio/local.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h
index b4bc5e01a..58a16bd47 100644
--- a/newlib/libc/stdio/local.h
+++ b/newlib/libc/stdio/local.h
@@ -45,7 +45,12 @@
section before reaching the end of the critical section's code end, use
the appropriate _newlib_XXX_exit macro. */
-#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS)
+#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS) \
+ && !defined (__rtems__)
+#define _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
+#endif
+
+#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
#include <pthread.h>
/* Start a stream oriented critical section: */
@@ -84,7 +89,7 @@
pthread_setcancelstate (__oldsfpcancel, &__oldsfpcancel); \
}
-#else /* __SINGLE_THREAD__ || !_POSIX_THREADS */
+#else /* !_STDIO_WITH_THREAD_CANCELLATION_SUPPORT */
# define _newlib_flockfile_start(_fp) \
{ \
@@ -108,7 +113,7 @@
__sfp_lock_release (); \
}
-#endif /* !__SINGLE_THREAD__ && _POSIX_THREADS */
+#endif /* _STDIO_WITH_THREAD_CANCELLATION_SUPPORT */
extern u_char *_EXFUN(__sccl, (char *, u_char *fmt));
extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));