summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/local.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2013-03-26 16:07:55 +0000
committerJoel Sherrill <joel.sherrill@oarcorp.com>2013-03-26 16:07:55 +0000
commit1ebc8da242a1e8dd7707f2bcc51c22d4e1e64990 (patch)
treecdad8b918a575fa56ab1e67de6c20a77c87d171b /newlib/libc/stdio/local.h
parent74d17001b47a38074b96c2b6e4ab8df0f146ab44 (diff)
downloadcygnal-1ebc8da242a1e8dd7707f2bcc51c22d4e1e64990.tar.gz
cygnal-1ebc8da242a1e8dd7707f2bcc51c22d4e1e64990.tar.bz2
cygnal-1ebc8da242a1e8dd7707f2bcc51c22d4e1e64990.zip
2013-03-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/stdio/local.h (_STDIO_WITH_THREAD_CANCELLATION_SUPPORT): New define. * libc/stdio/fclose.c: Use _STDIO_WITH_THREAD_CANCELLATION_SUPPORT. * libc/stdio/freopen.c: Likewise. * libc/stdio64/freopen64.c: Likewise.
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));