TIP: Click on subject to list as thread! ANSI
echo: muffin
to: Andrew Clarke
from: Wes Garland
date: 2003-06-02 07:16:44
subject: Maximus at UNIX

Hey, Andrew;

I have a few more messages in MUFFIN from the weekend that I want to
respond to, but I think this was important enough to jump in on.

#pragma lines are not to be used with GNU C. The correct syntax is (IIRC)

struct
{
  stuff;
} mystruct_t __attribute__((packed, align(2));

You can see many examples of this in the Maximus source, it was required in
order to be able to read FTSC packets, etc. The above example aligns on
16-bit boundaries, which is what FTSC-0001 packets are aligned as. So most
alignment changes I made in max/squish were done this way.   It's also how
I did a few other structs, ipc%02x.bbs, etc.

Tweaking the alignment parameters properly should allow us to read the
structs directly from disk into memory on little-endian machines. This is
adequate for the current version, but in the long run, we're still going to
need per-struct read routines, to support big-endian platforms.

Wes

--- Maximus/2 3.01
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
SEEN-BY: 633/267 270
@PATH: 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.