ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

pragma pack should be moved #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The packing directive should be specified immediately before the shared
structures and should be restored after defining the structures.

#pragma pack(1)
struct mg_request_info {
 // ...removed for clarity...
};
#pragma pack()

Because the mg_request_info is the only shared public structure it should
be the only one that is packed (if the comment currently above the pack
directive is correct.)  Also, it looks as if it should not require packing
as all the items look to be 32bit in length and would pack nicely anyway.

*Please note that I am writing from the Windows point of view and cannot
speak for *nix.

Original issue reported on code.google.com by gilbert....@gmail.com on 21 May 2009 at 5:50

GoogleCodeExporter commented 9 years ago
It looks like it is worth removing pack directive at all.
Since external prog which uses the header file might not specify packing thus 
may
conflict with mongoose DLL. I am not sure what happens on 64 bit platforms 
though.
However, I expect bindings to work OK.

Submitted http://code.google.com/p/mongoose/source/detail?r=368

Original comment by valenok on 21 May 2009 at 9:00