[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] [lwip] Packed structures
From: |
Florian Schulze |
Subject: |
[lwip-users] [lwip] Packed structures |
Date: |
Wed, 08 Jan 2003 22:37:54 -0000 |
Hi!
I'm currently using lwIP in DOS using DJGPP with GCC. I have to
use -fpack-struct for the full library to make it work, but this slows down the
library unnecessarily.
I know the following ways to pack structures in various compilers:
1. GCC
struct foo {
char a __attribute__((packed));
int b __attribute__((packed));
}
2. MS Visual C++ 5.0(and up) / GPP (GCC with C++)
#pragma pack(push,1)
struct foo {
char a;
int b;
}
#pragma pack(pop)
3. Others I have seen
#pragma pack(1)
struct foo {
char a;
int b;
}
#pragma pack()
and
#pragma pack 1
struct foo {
char a;
int b;
}
#pragma pack
Does anyone know more? How could this be generalised so only the structs which
really need it are packed like ip_hdr and arp_hdr?
Or should I just fix it for my own use?
Which structs need to be packed? I think there aren't many, only the headers of
the packets.
Florian
--
Florian 'Proff' Schulze - address@hidden
Homepage: - http://proff.fly.to
PGP-Key available from - http://www.keyserver.net/en/
[This message was sent through the lwip discussion list.]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] [lwip] Packed structures,
Florian Schulze <=