Annotation of /trunk/fontconfig/patches/fontconfig-2.12.1-gperf31.patch
Parent Directory | Revision Log
Revision 2859 -
(hide annotations)
(download)
Tue Mar 14 15:35:24 2017 UTC (7 years, 6 months ago) by niro
File size: 2196 byte(s)
Tue Mar 14 15:35:24 2017 UTC (7 years, 6 months ago) by niro
File size: 2196 byte(s)
-fixed ftbfs with gperf-3.1
1 | niro | 2859 | From 9878b306f6c673d3d6cd9db487f67eb426cc03df Mon Sep 17 00:00:00 2001 |
2 | From: Akira TAGOH <akira@tagoh.org> | ||
3 | Date: Thu, 23 Feb 2017 21:39:10 +0900 | ||
4 | Subject: [PATCH] Fix the build issue with gperf 3.1 | ||
5 | |||
6 | To support the one of changes in gperf 3.1: | ||
7 | * The 'len' parameter of the hash function and of the lookup function is now | ||
8 | of type 'size_t' instead of 'unsigned int'. This makes it safe to call these | ||
9 | functions with strings of length > 4 GB, on 64-bit machines. | ||
10 | --- | ||
11 | configure.ac | 20 ++++++++++++++++++++ | ||
12 | src/fcobjs.c | 4 ++-- | ||
13 | 2 files changed, 22 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/configure.ac b/configure.ac | ||
16 | index 4948816..8fbf3d3 100644 | ||
17 | --- a/configure.ac | ||
18 | +++ b/configure.ac | ||
19 | @@ -193,6 +193,26 @@ fi | ||
20 | AC_CHECK_MEMBERS([struct dirent.d_type],,, | ||
21 | [#include <dirent.h>]) | ||
22 | |||
23 | +# Check the argument type of the gperf hash/lookup function | ||
24 | +AC_MSG_CHECKING([The type of len parameter of gperf hash/lookup function]) | ||
25 | +fc_gperf_test="$(echo 'foo' | gperf -L ANSI-C)" | ||
26 | +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||
27 | + #include <string.h> | ||
28 | + | ||
29 | + const char *in_word_set(register const char *, register size_t); | ||
30 | + $fc_gperf_test | ||
31 | + ]])], [FC_GPERF_SIZE_T=size_t], | ||
32 | + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||
33 | + #include <string.h> | ||
34 | + | ||
35 | + const char *in_word_set(register const char *, register unsigned int); | ||
36 | + $fc_gperf_test | ||
37 | + ]])], [FC_GPERF_SIZE_T="unsigned int"], | ||
38 | + [AC_MSG_ERROR([Unable to determine the type of the len parameter of the gperf hash/lookup function])] | ||
39 | +)]) | ||
40 | +AC_DEFINE_UNQUOTED(FC_GPERF_SIZE_T, $FC_GPERF_SIZE_T, [The type of len parameter of the gperf hash/lookup function]) | ||
41 | +AC_MSG_RESULT($FC_GPERF_SIZE_T) | ||
42 | + | ||
43 | # | ||
44 | # Checks for iconv | ||
45 | # | ||
46 | diff --git a/src/fcobjs.c b/src/fcobjs.c | ||
47 | index 16ff31c..33bba8d 100644 | ||
48 | --- a/src/fcobjs.c | ||
49 | +++ b/src/fcobjs.c | ||
50 | @@ -25,10 +25,10 @@ | ||
51 | #include "fcint.h" | ||
52 | |||
53 | static unsigned int | ||
54 | -FcObjectTypeHash (register const char *str, register unsigned int len); | ||
55 | +FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len); | ||
56 | |||
57 | static const struct FcObjectTypeInfo * | ||
58 | -FcObjectTypeLookup (register const char *str, register unsigned int len); | ||
59 | +FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len); | ||
60 | |||
61 | #include "fcobjshash.h" | ||
62 | |||
63 | -- | ||
64 | 2.9.3 | ||
65 |