We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5e9464 commit e09e682Copy full SHA for e09e682
Alc/backends/opensl.c
@@ -297,10 +297,10 @@ static ALCboolean opensl_reset_playback(ALCdevice *Device)
297
format_pcm.channelMask = GetChannelMask(Device->FmtChans);
298
#ifdef HAVE_OPENSL_1_1
299
format_pcm.endianness = SL_BYTEORDER_NATIVE;
300
-#elif _BYTE_ORDER == _BIG_ENDIAN
301
- format_pcm.endianness = SL_BYTEORDER_BIGENDIAN;
302
#else
303
- format_pcm.endianness = SL_BYTEORDER_LITTLEENDIAN;
+ union { unsigned short num; char buf[sizeof(unsigned short)]; } endianness;
+ endianness.num = 1;
+ format_pcm.endianness = endianness.buf[0] ? SL_BYTEORDER_LITTLEENDIAN : SL_BYTEORDER_BIGENDIAN;
304
#endif
305
306
audioSrc.pLocator = &loc_bufq;
0 commit comments