The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / gd / 0003-gd_bmp-fix-build-with-uClibc.patch
1 From ea2a03e983acf34a1320b460dcad43b7e0b0b14f Mon Sep 17 00:00:00 2001
2 Message-Id: <ea2a03e983acf34a1320b460dcad43b7e0b0b14f.1397134306.git.baruch@tkos.co.il>
3 From: Baruch Siach <baruch@tkos.co.il>
4 Date: Thu, 10 Apr 2014 15:49:13 +0300
5 Subject: [PATCH] gd_bmp: fix build with uClibc
6
7 Some architectures (like ARM) don't have the long double variants of math
8 functions under uClibc. Add a local ceill definition in this case.
9
10 Patch status: reported upstream, 
11 https://bitbucket.org/libgd/gd-libgd/issue/123/build-failure-agains-uclibc-arm
12
13 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
14 ---
15  src/gd_bmp.c | 12 ++++++++++++
16  1 file changed, 12 insertions(+)
17
18 diff --git a/src/gd_bmp.c b/src/gd_bmp.c
19 index 0fc021909f1b..11b3ec1baa01 100644
20 --- a/src/gd_bmp.c
21 +++ b/src/gd_bmp.c
22 @@ -25,6 +25,11 @@
23  #include "gdhelpers.h"
24  #include "bmp.h"
25  
26 +#include <features.h>
27 +#if defined (__UCLIBC__) && !defined(__UCLIBC_HAS_LONG_DOUBLE_MATH__)
28 +#define NO_LONG_DOUBLE
29 +#endif
30 +
31  static int compress_row(unsigned char *uncompressed_row, int length);
32  static int build_rle_packet(unsigned char *row, int packet_type, int length, unsigned char *data);
33  
34 @@ -42,6 +47,13 @@ static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info);
35  
36  #define BMP_DEBUG(s)
37  
38 +#ifdef NO_LONG_DOUBLE
39 +long double ceill(long double x)
40 +{
41 +       return (long double) ceil((double) x);
42 +}
43 +#endif
44 +
45  static int gdBMPPutWord(gdIOCtx *out, int w)
46  {
47         /* Byte order is little-endian */
48 -- 
49 1.9.1
50