Add specific #pragma pack(1) for TCC, fixes packed alignment issues
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
6223ca323c
commit
f018396b1d
|
@ -63,6 +63,10 @@
|
||||||
/* Test for GCC >= 4.4.0, see https://gcc.gnu.org/gcc-4.4/changes.html : Packed bit-fields of type char were not properly bit-packed on many targets prior to GCC 4.4 */
|
/* Test for GCC >= 4.4.0, see https://gcc.gnu.org/gcc-4.4/changes.html : Packed bit-fields of type char were not properly bit-packed on many targets prior to GCC 4.4 */
|
||||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 4)) || __clang__ || __TINYC__
|
#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 4)) || __clang__ || __TINYC__
|
||||||
|
|
||||||
|
#if defined(__TINYC__)
|
||||||
|
#pragma pack(1)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
struct {
|
struct {
|
||||||
|
@ -109,6 +113,10 @@ typedef struct {
|
||||||
uint32_t sizeInMbit;
|
uint32_t sizeInMbit;
|
||||||
} KNOWN_FLASH_DEVICE;
|
} KNOWN_FLASH_DEVICE;
|
||||||
|
|
||||||
|
#if defined(__TINYC__)
|
||||||
|
#pragma pack(1)
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error "Packed bit-fields of type char were not properly bit-packed on many targets prior to GCC 4.4, upgrade to GCC >= 4.4."
|
#error "Packed bit-fields of type char were not properly bit-packed on many targets prior to GCC 4.4, upgrade to GCC >= 4.4."
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue