7764aabc64b1c5b0e0b05bb9f77dca94ee8dc6b8
[feed/packages.git] / sound / shairplay / patches / 003-fix_big-endian.patch
1 --- a/src/lib/alac/alac.c
2 +++ b/src/lib/alac/alac.c
3 @@ -29,11 +29,7 @@
4 *
5 */
6
7 -#ifdef __BIG_ENDIAN__
8 -static const int host_bigendian = 1;
9 -#else
10 -static const int host_bigendian = 0;
11 -#endif
12 +static int host_bigendian = 0;
13
14 #include <stdio.h>
15 #include <stdlib.h>
16 @@ -1181,6 +1177,8 @@ alac_file *create_alac(int samplesize, i
17 {
18 alac_file *newfile = malloc(sizeof(alac_file));
19
20 + host_bigendian = (htonl(42) == 42);
21 +
22 newfile->samplesize = samplesize;
23 newfile->numchannels = numchannels;
24 newfile->bytespersample = (samplesize / 8) * numchannels;