xref: /OK3568_Linux_fs/buildroot/package/musepack/0003-include-fpu-control-with-glibc-only.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunInclude <fpu_control.h> only on glibc systems
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThe <fpu_control.h> header provides _FPU_*() macros, which the
4*4882a593SmuzhiyunInit_FPU() function uses only on i386, and only when they are
5*4882a593Smuzhiyundefined. Since <fpu_control.h> is not available, this causes a build
6*4882a593Smuzhiyunfailure with C libraries such as musl. By simply including
7*4882a593Smuzhiyun<fpu_control.h> explicitly on glibc systems, we avoid the build
8*4882a593Smuzhiyunfailure, since mpcenc.c already conditionally uses the <fpu_control.h>
9*4882a593Smuzhiyunmacros only if they are defined.
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunSigned-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
12*4882a593Smuzhiyun[Thomas: better commit log.]
13*4882a593SmuzhiyunSigned-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
14*4882a593Smuzhiyun
15*4882a593Smuzhiyundiff -uNr musepack_src_r475.org/mpcenc/mpcenc.h musepack_src_r475/mpcenc/mpcenc.h
16*4882a593Smuzhiyun--- musepack_src_r475.org/mpcenc/mpcenc.h	2009-02-23 19:15:46.000000000 +0100
17*4882a593Smuzhiyun+++ musepack_src_r475/mpcenc/mpcenc.h	2016-01-30 09:29:08.000000000 +0100
18*4882a593Smuzhiyun@@ -50,7 +51,7 @@
19*4882a593Smuzhiyun # include <unistd.h>
20*4882a593Smuzhiyun #endif
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun-#if   defined __linux__
23*4882a593Smuzhiyun+#if   defined __GLIBC__
24*4882a593Smuzhiyun #  include <fpu_control.h>
25*4882a593Smuzhiyun #elif defined __FreeBSD__
26*4882a593Smuzhiyun # include <machine/floatingpoint.h>
27