mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
topology: fix the unaligned access
Introduce unaligned_get32/put32 helpers to deal with the packed structures. Use the gcc __BYTE_ORDER__ defines for the endian checks. It may be improved to support other compilation environment. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
84c6aeef5c
commit
ab73253924
3 changed files with 29 additions and 16 deletions
|
|
@ -427,10 +427,8 @@ void snd_tplg_verbose(snd_tplg_t *tplg, int verbose)
|
|||
|
||||
static bool is_little_endian(void)
|
||||
{
|
||||
#ifdef __BYTE_ORDER
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
return true;
|
||||
#endif
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_INT__ == 4
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue