1From 8208f99fa1676c42bfd8d74de3e9dac5366c150c Mon Sep 17 00:00:00 2001 2From: Akira TAGOH <akira@tagoh.org> 3Date: Mon, 3 Sep 2018 04:56:16 +0000 4Subject: [PATCH] Fix the build issue with --enable-static 5 6Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/109 7Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 8[Retrieved from: 9https://gitlab.freedesktop.org/fontconfig/fontconfig/commit/8208f99fa1676c42bfd8d74de3e9dac5366c150c] 10--- 11 doc/fcstring.fncs | 12 ++++++++++++ 12 fontconfig/fontconfig.h | 4 ++++ 13 src/fcint.h | 4 ---- 14 test/test-bz106632.c | 35 ++++++++++++----------------------- 15 4 files changed, 28 insertions(+), 27 deletions(-) 16 17diff --git a/doc/fcstring.fncs b/doc/fcstring.fncs 18index 0412bbd..d5ec043 100644 19--- a/doc/fcstring.fncs 20+++ b/doc/fcstring.fncs 21@@ -223,6 +223,18 @@ This is just a wrapper around free(3) which helps track memory usage of 22 strings within the fontconfig library. 23 @@ 24 25+@RET@ FcChar8 * 26+@FUNC@ FcStrBuildFilename 27+@TYPE1@ const FcChar8 * @ARG1@ path 28+@TYPE2@ ... 29+@PURPOSE@ Concatenate strings as a file path 30+@DESC@ 31+Creates a filename from the given elements of strings as file paths 32+and concatenate them with the appropriate file separator. 33+Arguments must be null-terminated. 34+This returns a newly-allocated memory which should be freed when no longer needed. 35+@@ 36+ 37 @RET@ FcChar8 * 38 @FUNC@ FcStrDirname 39 @TYPE1@ const FcChar8 * @ARG1@ file 40diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h 41index bac1dda..af870d0 100644 42--- a/fontconfig/fontconfig.h 43+++ b/fontconfig/fontconfig.h 44@@ -1076,6 +1076,10 @@ FcUtf16Len (const FcChar8 *string, 45 int *nchar, 46 int *wchar); 47 48+FcPublic FcChar8 * 49+FcStrBuildFilename (const FcChar8 *path, 50+ ...); 51+ 52 FcPublic FcChar8 * 53 FcStrDirname (const FcChar8 *file); 54 55diff --git a/src/fcint.h b/src/fcint.h 56index de78cd8..a9d075a 100644 57--- a/src/fcint.h 58+++ b/src/fcint.h 59@@ -1282,10 +1282,6 @@ FcStrUsesHome (const FcChar8 *s); 60 FcPrivate FcBool 61 FcStrIsAbsoluteFilename (const FcChar8 *s); 62 63-FcPrivate FcChar8 * 64-FcStrBuildFilename (const FcChar8 *path, 65- ...); 66- 67 FcPrivate FcChar8 * 68 FcStrLastSlash (const FcChar8 *path); 69 70diff --git a/test/test-bz106632.c b/test/test-bz106632.c 71index daa0c1e..2d67c2e 100644 72--- a/test/test-bz106632.c 73+++ b/test/test-bz106632.c 74@@ -25,25 +25,26 @@ 75 #ifdef HAVE_CONFIG_H 76 #include "config.h" 77 #endif 78+#include <stdio.h> 79 #include <stdlib.h> 80+#include <string.h> 81 #include <dirent.h> 82+#include <unistd.h> 83+#include <errno.h> 84 #ifndef HAVE_STRUCT_DIRENT_D_TYPE 85 #include <sys/types.h> 86 #include <sys/stat.h> 87-#include <unistd.h> 88 #endif 89-#include "fcstr.c" 90-#undef FcConfigBuildFonts 91-#undef FcConfigCreate 92-#undef FcConfigGetCurrent 93-#undef FcConfigParseAndLoadFromMemory 94-#undef FcConfigUptoDate 95-#undef FcFontList 96-#undef FcInitReinitialize 97-#undef FcPatternCreate 98-#undef FcPatternDestroy 99 #include <fontconfig/fontconfig.h> 100 101+#ifdef _WIN32 102+# define FC_DIR_SEPARATOR '\\' 103+# define FC_DIR_SEPARATOR_S "\\" 104+#else 105+# define FC_DIR_SEPARATOR '/' 106+# define FC_DIR_SEPARATOR_S "/" 107+#endif 108+ 109 #ifdef HAVE_MKDTEMP 110 #define fc_mkdtemp mkdtemp 111 #else 112@@ -154,18 +155,6 @@ unlink_dirs (const char *dir) 113 return ret; 114 } 115 116-FcChar8 * 117-FcLangNormalize (const FcChar8 *lang) 118-{ 119- return NULL; 120-} 121- 122-FcChar8 * 123-FcConfigHome (void) 124-{ 125- return NULL; 126-} 127- 128 int 129 main (void) 130 { 131-- 1322.18.1 133 134