if __packed exists, use it. I might revert this later when I fully implement

attribute for lint.
This commit is contained in:
christos 2009-10-02 21:05:10 +00:00
parent 876a5b04b7
commit 5cf5db250b
2 changed files with 8 additions and 2 deletions

View File

@ -1040,7 +1040,10 @@ Fixes to avoid code generation warning/error on FreeBSD 7
// In the event that structures are not packed correctly, mDNS_Init() will detect this and report an error, so the
// developer will know what's wrong, and can investigate what needs to be done on that compiler to provide proper packing.
#ifndef packedstruct
#if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
#ifdef __packed
#define packedstruct struct __packed
#define packedunion union __packed
#elif ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
#define packedstruct struct __attribute__((__packed__))
#define packedunion union __attribute__((__packed__))
#else

View File

@ -234,7 +234,10 @@ Update to APSL 2.0
// structures correctly anyway, so a plain "struct" is usually fine. In the event that structures are not packed
// correctly, our compile-time assertion checks will catch it and prevent inadvertent generation of non-working code.
#ifndef packedstruct
#if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
#ifdef __packed
#define packedstruct struct __packed
#define packedunion union __packed
#elif ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
#define packedstruct struct __attribute__((__packed__))
#define packedunion union __attribute__((__packed__))
#else