April 6th, 1999, 02:51 PM
Is the preprocessor command:
#pragma pack(...)
A Microsoft compiler dependant command? I looked through the help and couldn't really find out for sure.
I'm making a DLL which will use a struct data type. The struct will be declared in a header file which will be used by the DLL project itself and programs using the DLL.
I want to make sure that the other programs compile the structure under the same packing style. If all programs were using Microsoft VC++ compilers, I could use #pragma pack(16).
However, some programs might be using a different compiler. So putting #pragma pack(16) in the header would confuse the other compiler.
If there is something else besides #pragma pack which ensures a specific structure layout over all compilers, I'd love to know it.
Thanks
Steve
#pragma pack(...)
A Microsoft compiler dependant command? I looked through the help and couldn't really find out for sure.
I'm making a DLL which will use a struct data type. The struct will be declared in a header file which will be used by the DLL project itself and programs using the DLL.
I want to make sure that the other programs compile the structure under the same packing style. If all programs were using Microsoft VC++ compilers, I could use #pragma pack(16).
However, some programs might be using a different compiler. So putting #pragma pack(16) in the header would confuse the other compiler.
If there is something else besides #pragma pack which ensures a specific structure layout over all compilers, I'd love to know it.
Thanks
Steve