mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Fixed CPU endian detection
This commit is contained in:
parent
9b19453059
commit
de19ad72ab
@ -57,14 +57,14 @@ namespace {
|
||||
{
|
||||
// Detect CPU endian.
|
||||
union {
|
||||
wchar_t w;
|
||||
char c[2];
|
||||
} x = { 0xfeff };
|
||||
TagLib::ushort w;
|
||||
char c;
|
||||
} x = { 0x1234 };
|
||||
|
||||
if(x.c[0] == 0xfe)
|
||||
return String::UTF16BE;
|
||||
else
|
||||
if(x.c == 0x34)
|
||||
return String::UTF16LE;
|
||||
else
|
||||
return String::UTF16BE;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user