[PATCH 2/3] SPU stdio: FILE related stuffs

Kazunori Asayama asayama@sm.sony.co.jp
Thu Feb 1 02:41:00 GMT 2007


Jeff Johnston <jjohnstn@redhat.com> wrote:
>    I was not happy with the part of this patch that touched stdio.h and 
> reent.h as I don't want machine-specific changes in these files.  I have 
> come up with an alternate patch for those sections I wasn't happy with.

OK. I see.

>    Please try it out.  Just back out your changes to 
> libc/include/stdio.h and libc/include/sys/reent.h, then apply my patch 
> to verify it all works for you.  The rest of your patch is spu-specific 
> and once the additional code is verified, I'll check it all in.

Thanks a lot. I tried your changes, but one fix was needed because of
a typo in sys/reent.h as following:

> --- libc/include/sys/reent.h	26 Sep 2006 21:22:19 -0000	1.36
> +++ libc/include/sys/reent.h	31 Jan 2007 21:50:51 -0000
> @@ -212,6 +212,12 @@ struct __sFILE {
>  #endif
>  };
>  
> +#ifdef __CUSTOM_FILE_IO___

There are too many '_'s at the end of the line. It should be
'#ifdef __CUSTOM_FILE_IO__'.

With this fix, all worked well.

Here is a fixed patch of libc/include/sys/reent.h.
----
Index: libc/include/sys/reent.h
===================================================================
--- libc/include/sys/reent.h
+++ libc/include/sys/reent.h
@@ -212,6 +212,12 @@ struct __sFILE {
 #endif
 };
 
+#ifdef __CUSTOM_FILE_IO__
+
+/* Get custom _FILE definition.  */
+#include <sys/custom_file.h>
+
+#else /* !__CUSTOM_FILE_IO__ */
 #ifdef __LARGE64_FILES
 struct __sFILE64 {
   unsigned char *_p;	/* current position in (some) buffer */
@@ -260,6 +266,7 @@ typedef struct __sFILE64 __FILE;
 #else
 typedef struct __sFILE   __FILE;
 #endif /* __LARGE64_FILES */
+#endif /* !__CUSTOM_FILE_IO__ */
 
 struct _glue 
 {
@@ -459,6 +466,10 @@ extern const struct __sFILE_fake __sf_fa
 #define __reent_assert(x) ((void)0)
 #endif
 
+#ifdef __CUSTOM_FILE_IO__
+#error Custom FILE I/O and _REENT_SMALL not currently supported.
+#endif
+
 /* Generic _REENT check macro.  */
 #define _REENT_CHECK(var, what, type, size, init) do { \
   struct _reent *_r = (var); \



More information about the Newlib mailing list