mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
Move ma_is_little_endian() / ma_is_big_endian() into the public section.
This commit is contained in:
+16
-16
@@ -4124,6 +4124,22 @@ typedef ma_uint16 ma_wchar_win32;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static MA_INLINE ma_bool32 ma_is_little_endian(void)
|
||||||
|
{
|
||||||
|
#if defined(MA_X86) || defined(MA_X64)
|
||||||
|
return MA_TRUE;
|
||||||
|
#else
|
||||||
|
int n = 1;
|
||||||
|
return (*(char*)&n) == 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static MA_INLINE ma_bool32 ma_is_big_endian(void)
|
||||||
|
{
|
||||||
|
return !ma_is_little_endian();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Basic Functions
|
Basic Functions
|
||||||
===============
|
===============
|
||||||
@@ -11708,22 +11724,6 @@ static MA_INLINE ma_bool32 ma_has_neon(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static MA_INLINE ma_bool32 ma_is_little_endian(void)
|
|
||||||
{
|
|
||||||
#if defined(MA_X86) || defined(MA_X64)
|
|
||||||
return MA_TRUE;
|
|
||||||
#else
|
|
||||||
int n = 1;
|
|
||||||
return (*(char*)&n) == 1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static MA_INLINE ma_bool32 ma_is_big_endian(void)
|
|
||||||
{
|
|
||||||
return !ma_is_little_endian();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static MA_INLINE ma_uint32 ma_swap_endian_uint32(ma_uint32 n)
|
static MA_INLINE ma_uint32 ma_swap_endian_uint32(ma_uint32 n)
|
||||||
{
|
{
|
||||||
#ifdef MA_HAS_BYTESWAP32_INTRINSIC
|
#ifdef MA_HAS_BYTESWAP32_INTRINSIC
|
||||||
|
|||||||
Reference in New Issue
Block a user