[Scummvm-devel] START_PACK_STRUCTS default changed -- portbreakage
Stuart George
yakumo9275 at gmail.com
Sun Jul 23 14:50:05 CEST 2006
On 7/22/06, Eugene Sandulenko <sev at scummvm.org> wrote:
> On Sat, 22 Jul 2006 21:16:32 +0200
> "Chris Apers" <chrilith at hotmail.com> wrote:
>
> > I agree with you regarding use of non packed structs, this should fix
> > Lots of PalmOS problem, but as you said it will be a lot of work
> In any case, work on it should be considered by engine maintainers, and
> packed structs should not be used by any new code.
>
> MemoryReadStream is a perfect way to read into packed struct in a
> portable fashion.
I am curious as to why palmos has problems with struct packing?
I recall when I wrote a palmos app that __attribute__((packed)) worked fine
and my cross platform code worked ok.. EG:
#ifndef __GNUC__
#define PACKED __attribute__((packed))
#else
#define PACKED
#endif
#pramga pack(1)
struct x
{
char a PACKED;
int b PACKED;
} PACKED;
#pragma pack()
I recall I had no problem on vc6, watcom10 or gcc 2/3/4...
now _some_ versions of gcc required PACKED on every item in struct,
some versions required only after the tail '}' and some gcc even
understood pragma... my understanding was CW also understood pragma pack
(I have not used CW since version... v7 or 8)
unless of course the palmos gcc was compiled to specifically remove
attribute packed....
gp32 also obeys the __attribute__((packed)) just fine
--
-- Stuart George
Homepage : http://mega-tokyo.com
More information about the Scummvm-devel
mailing list