Resync with broadcom drivers 5.100.138.20 and utilities.
[tomato.git] / release / src-rt / include / packed_section_end.h
blob6a782fd5db17f70ce6957adc2db5606f3c0e4ae3
1 /*
2 * Declare directives for structure packing. No padding will be provided
3 * between the members of packed structures, and therefore, there is no
4 * guarantee that structure members will be aligned.
6 * Declaring packed structures is compiler specific. In order to handle all
7 * cases, packed structures should be delared as:
9 * #include <packed_section_start.h>
11 * typedef BWL_PRE_PACKED_STRUCT struct foobar_t {
12 * some_struct_members;
13 * } BWL_POST_PACKED_STRUCT foobar_t;
15 * #include <packed_section_end.h>
18 * Copyright (C) 2010, Broadcom Corporation. All Rights Reserved.
20 * Permission to use, copy, modify, and/or distribute this software for any
21 * purpose with or without fee is hereby granted, provided that the above
22 * copyright notice and this permission notice appear in all copies.
24 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
25 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
27 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
28 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
29 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
30 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
31 * $Id: packed_section_end.h,v 1.4 2008-12-09 23:43:22 Exp $
35 /* Error check - BWL_PACKED_SECTION is defined in packed_section_start.h
36 * and undefined in packed_section_end.h. If it is NOT defined at this
37 * point, then there is a missing include of packed_section_start.h.
39 #ifdef BWL_PACKED_SECTION
40 #undef BWL_PACKED_SECTION
41 #else
42 #error "BWL_PACKED_SECTION is NOT defined!"
43 #endif
46 #if defined(_MSC_VER)
47 /* Disable compiler warning about pragma pack changing alignment. */
48 #pragma warning(disable:4103)
50 /* The Microsoft compiler uses pragmas for structure packing. Other
51 * compilers use structure attribute modifiers. Refer to
52 * BWL_PRE_PACKED_STRUCT and BWL_POST_PACKED_STRUCT defined in
53 * typedefs.h
55 #if defined(BWL_DEFAULT_PACKING)
56 /* require default structure packing */
57 #pragma pack(pop)
58 #undef BWL_DEFAULT_PACKING
59 #else /* BWL_PACKED_SECTION */
60 #pragma pack()
61 #endif /* BWL_PACKED_SECTION */
62 #endif /* _MSC_VER */
65 /* Compiler-specific directives for structure packing are declared in
66 * packed_section_start.h. This marks the end of the structure packing section,
67 * so, undef them here.
69 #undef BWL_PRE_PACKED_STRUCT
70 #undef BWL_POST_PACKED_STRUCT