Patrick Mansfield wrote:
fpos_t is 12 bytes for 32 bit ppc glibc, and 16 bytes for 64 bit.
Currently SPU newlib uses 4 bytes for fpos_t. This is always a problem
with 64 bit ppc, since the fgetpos() assist call writes 8 bytes back for
the offset, and is a potential problem with 32 bit ppc.
So for SPU always use 16 bytes for fpos_t and also make currently unused
(in SPU) _fpos64_t 16 bytes.
Patrick,
This needs to be cleaned up. Not your fault, but I don't want cpu
checks in sys/reent.h and I don't think that _fpos_t should be magically
defined in sys/reent.h. The following proposal makes this change and
others easy for you to do. It is pretty straightforward.
So, this is what I propose:
1. copy machine/_types.h to machine/_default_types.h
2. make machine/_types.h simply include machine/_default_types.h
3. have sys/_types.h include machine/_types.h
4. have sys/_types.h look for flags before defining _ types. For
example, #ifndef _OFF_T_DEFINED). You need to add
_fpos_t and _fpos64_t default defs which weren't there previously
5. create an machine/spu/machine/_types.h which defines all of these
to your liking...also set the flags on so sys/_types.h won't try
and define them
6. remove _fpos_t and _fpos64_t defs from sys/reent.h
This will be clean and allow other platforms to do tweaking as
desired without cluttering up the common headers.
Comments?