mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 03:40:30 +00:00
audio/utils: use static_assert for endianness
Use static_assert to ensure little endian instead of the preprocessor checks - if the those macros are not defined by the compiler, the check will be eliminated. If other complier is used, write this more generically.
This commit is contained in:
@@ -56,9 +56,8 @@
|
||||
#include "utils/macros.h"
|
||||
#include "utils/misc.h"
|
||||
|
||||
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
#error "This code will not run with a big-endian machine. Please report a bug if you reach here."
|
||||
#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
|
||||
"The code below assumes little endianness.");
|
||||
|
||||
using std::clamp;
|
||||
using std::max;
|
||||
|
||||
Reference in New Issue
Block a user