[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Win32 vs. PACK_STRUCT_BEGIN
From: |
Bob Ammerman |
Subject: |
[lwip-users] Win32 vs. PACK_STRUCT_BEGIN |
Date: |
Tue, 28 Jan 2003 12:50:29 -0500 |
I am planning on using lwIP to add tcp/ip connectivity to an embedded
system. The system is x86 based, and runs a homebrew kernel which is a
(small) subset of Win32. I use the Microsoft Visual C++ compiler and tools
to build my executable.
I have begun working with the source to see how much effort it will be to
port over. I have run into PACK_STRUCT_BEGIN / PACK_STRUCT_END issue.
Microsoft themselves handle this using the include file trick. I know that
it is ugly, but is really the only way to handle it (other than putting
#ifdefs in the code). You could avoid breaking existing usages of the
package as follows:
in arch\cc.c:
#define PACK_NEEDS_INCLUDES // define only in ARCH's that need it
in ip_addr.h and similar locations:
#ifdef PACK_NEEDS_INCLUDES
#include "arch\pack_begin_struct.h"
#endif
PACK_BEGIN_STRUCT
struct ip_addr {
...
} PACK_STRUCT_STRUCT;
PACK_END_STRUCT
#ifdef PACK_NEEDS_INCLUDES
#include "arch\pack_end_struct.h"
#endif
- [lwip-users] Win32 vs. PACK_STRUCT_BEGIN,
Bob Ammerman <=