[Buildroot] [PATCH] pcre2: add patch fixing a build issue on m68k
Peter Korsgaard
peter at korsgaard.com
Tue Feb 27 10:20:55 UTC 2018
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni at bootlin.com> writes:
Hi,
> However, it is true that on non-m68k platform, the single PCRE2_UCHAR
> occu[1] will probably be aligned on a 32-bit boundary, which indeed
> would shift the rest of the structure.
> So perhaps I should instead do something like this:
> uint8_t return_id;
> uint8_t op;
> #if PCRE2_CODE_UNIT_WIDTH == 8
> PCRE2_UCHAR occu[6]; /* Used for other case code units */
> #elif PCRE2_CODE_UNIT_WIDTH == 16
> PCRE2_UCHAR occu[2]; /* Used for other case code units */
> uint8_t unused[2]; /* Ensure 32 bit alignment */
> #else
> uint8_t unused[2]; /* Ensure 32 bit alignment */
> PCRE2_UCHAR occu[1]; /* Used for other case code units */
> #endif
> PCRE2_SPTR eptr;
> This should give the same offset for the different fields, regardless
> of the architecture, correct ?
Yes, indeed!
--
Bye, Peter Korsgaard
More information about the buildroot
mailing list