aboutsummaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/libio.h20
-rw-r--r--libio/libioP.h9
2 files changed, 17 insertions, 12 deletions
diff --git a/libio/libio.h b/libio/libio.h
index 9e8c108..1dddaf2 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -26,7 +26,6 @@
#ifndef _IO_STDIO_H
#define _IO_STDIO_H
-#include <features.h>
#include <_G_config.h>
#define _IO_pos_t _G_fpos_t /* obsolete */
@@ -76,12 +75,6 @@
# define _IO_USE_DTOA 1
#endif
-#if 0
-# ifdef _IO_NEED_STDARG_H
-# include <stdarg.h>
-# endif
-#endif
-
#ifndef EOF
# define EOF (-1)
#endif
@@ -156,7 +149,11 @@ struct _IO_jump_t; struct _IO_FILE;
/* Handle lock. */
#ifdef _IO_MTSAFE_IO
-# include <bits/stdio-lock.h>
+# if defined __GLIBC__ && __GLIBC__ >= 2
+# include <bits/stdio-lock.h>
+# else
+/*# include <comthread.h>*/
+# endif
#else
typedef void _IO_lock_t;
#endif
@@ -290,7 +287,10 @@ extern void _IO_flockfile __P ((_IO_FILE *));
extern void _IO_funlockfile __P ((_IO_FILE *));
extern int _IO_ftrylockfile __P ((_IO_FILE *));
-#ifndef _IO_MTSAFE_IO
+#ifdef _IO_MTSAFE_IO
+# define _IO_peekc(_fp) _IO_peekc_locked (_fp)
+#else
+# define _IO_peekc(_fp) _IO_peekc_unlocked (_fp)
# define _IO_flockfile(_fp) /**/
# define _IO_funlockfile(_fp) /**/
# define _IO_ftrylockfile(_fp) /**/
@@ -298,8 +298,6 @@ extern int _IO_ftrylockfile __P ((_IO_FILE *));
# define _IO_cleanup_region_end(_Doit) /**/
#endif /* !_IO_MTSAFE_IO */
-#define _IO_peekc(_fp) _IO_peekc_locked (_fp)
-
extern int _IO_vfscanf __P ((_IO_FILE *, const char *, _IO_va_list, int *));
extern int _IO_vfprintf __P ((_IO_FILE *, const char *, _IO_va_list));
extern _IO_ssize_t _IO_padn __P ((_IO_FILE *, int, _IO_ssize_t));
diff --git a/libio/libioP.h b/libio/libioP.h
index 66acb93..2337071 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -24,7 +24,14 @@
General Public License. */
#include <errno.h>
-#include <bits/libc-lock.h>
+#ifndef __set_errno
+# define __set_errno(Val) errno = (Val)
+#endif
+#if defined __GLIBC__ && __GLIBC__ >= 2
+# include <bits/libc-lock.h>
+#else
+/*# include <comthread.h>*/
+#endif
#include "iolibio.h"