OSDN Git Service

* configure.in (target frags): Add powerpc*-linux-gnulibc1.
[pf3gnuchains/gcc-fork.git] / libio / libio.h
index 2eec1c2..b7f8af7 100644 (file)
 # define const
 #endif
 #define _IO_UNIFIED_JUMPTABLES 1
-#ifndef _G_HAVE_PRINTF_FP
+#if !_G_HAVE_PRINTF_FP
 # define _IO_USE_DTOA 1
 #endif
 
-#if 0
-# ifdef _IO_NEED_STDARG_H
-#  include <stdarg.h>
-# endif
-#endif
-
 #ifndef EOF
 # define EOF (-1)
 #endif
@@ -155,9 +149,28 @@ struct _IO_jump_t;  struct _IO_FILE;
 
 /* Handle lock.  */
 #ifdef _IO_MTSAFE_IO
-# include <bits/stdio-lock.h>
+# if defined __GLIBC__ && __GLIBC__ >= 2
+#  if __GLIBC_MINOR__ > 0
+#   include <bits/stdio-lock.h>
+#  else
+#   include <stdio-lock.h>
+#  endif
+#  define _IO_LOCK_T _IO_lock_t *
+# else
+/*# include <comthread.h>*/
+# endif
 #else
-typedef void _IO_lock_t;
+# if defined(__GLIBC__) && __GLIBC__ >= 2
+   typedef void _IO_lock_t;
+#  define _IO_LOCK_T void *
+# else
+#  ifdef __linux__
+    struct _IO_lock_t { void *ptr; short int field1; short int field2; };
+#   define _IO_LOCK_T struct _IO_lock_t
+#  else
+    typedef void _IO_lock_t;
+#  endif
+# endif
 #endif
 
 
@@ -217,7 +230,9 @@ struct _IO_FILE {
 
   /*  char* _save_gptr;  char* _save_egptr; */
 
-  _IO_lock_t *_lock;
+#ifdef _IO_LOCK_T
+  _IO_LOCK_T _lock;
+#endif
 };
 
 #ifndef __cplusplus
@@ -289,7 +304,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) /**/
@@ -297,7 +315,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));