board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / gd / 0002-gd_bmp-fix-build-with-uClibc.patch
blob89bc39186ea8126726d9a978ac0224e16878091c
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
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.
10 Patch status: reported upstream,
11 https://bitbucket.org/libgd/gd-libgd/issue/123/build-failure-agains-uclibc-arm
13 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
14 ---
15 src/gd_bmp.c | 12 ++++++++++++
16 1 file changed, 12 insertions(+)
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"
26 +#include <features.h>
27 +#if defined (__UCLIBC__) && !defined(__UCLIBC_HAS_LONG_DOUBLE_MATH__)
28 +#define NO_LONG_DOUBLE
29 +#endif
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);
34 @@ -42,6 +47,13 @@ static int bmp_read_rle(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info);
36 #define BMP_DEBUG(s)
38 +#ifdef NO_LONG_DOUBLE
39 +long double ceill(long double x)
41 + return (long double) ceil((double) x);
43 +#endif
45 static int gdBMPPutWord(gdIOCtx *out, int w)
47 /* Byte order is little-endian */
48 --
49 1.9.1