aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig/src')
-rw-r--r--fontconfig/src/Makefile.am2
-rw-r--r--fontconfig/src/fcatomic.c7
-rw-r--r--fontconfig/src/fccfg.c18
-rw-r--r--fontconfig/src/fcint.h2
-rw-r--r--fontconfig/src/fcstat.c16
-rw-r--r--fontconfig/src/fcstr.c6
-rw-r--r--fontconfig/src/fcxml.c24
7 files changed, 41 insertions, 34 deletions
diff --git a/fontconfig/src/Makefile.am b/fontconfig/src/Makefile.am
index 65ec1e3bb..3dd69dde9 100644
--- a/fontconfig/src/Makefile.am
+++ b/fontconfig/src/Makefile.am
@@ -134,9 +134,11 @@ libfontconfig_la_LIBADD = $(ICONV_LIBS) $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT
libfontconfig_la_DEPENDENCIES = $(fontconfig_def_dependency)
+if ENABLE_SHARED
install-data-local: install-ms-import-lib install-libtool-import-lib
uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib
+endif
PUBLIC_FILES = \
$(top_srcdir)/fontconfig/fontconfig.h \
diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c
index 96f01235f..557dbc970 100644
--- a/fontconfig/src/fcatomic.c
+++ b/fontconfig/src/fcatomic.c
@@ -100,12 +100,13 @@ FcAtomicCreate (const FcChar8 *file)
FcBool
FcAtomicLock (FcAtomic *atomic)
{
- int fd = -1;
- FILE *f = 0;
int ret;
struct stat lck_stat;
#ifdef HAVE_LINK
+ int fd = -1;
+ FILE *f = 0;
+
strcpy ((char *) atomic->tmp, (char *) atomic->file);
strcat ((char *) atomic->tmp, TMP_NAME);
fd = mkstemp ((char *) atomic->tmp);
@@ -186,7 +187,7 @@ FcBool
FcAtomicReplaceOrig (FcAtomic *atomic)
{
#ifdef _WIN32
- unlink (atomic->file);
+ unlink ((const char *) atomic->file);
#endif
if (rename ((char *) atomic->new, (char *) atomic->file) < 0)
return FcFalse;
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c
index 3f1fa73df..d3752e552 100644
--- a/fontconfig/src/fccfg.c
+++ b/fontconfig/src/fccfg.c
@@ -1672,7 +1672,7 @@ DllMain (HINSTANCE hinstDLL,
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
- if (!GetModuleFileName ((HMODULE) hinstDLL, fontconfig_path,
+ if (!GetModuleFileName ((HMODULE) hinstDLL, (LPCH) fontconfig_path,
sizeof (fontconfig_path)))
break;
@@ -1681,15 +1681,15 @@ DllMain (HINSTANCE hinstDLL,
* "etc/fonts" in there as FONTCONFIG_PATH. Otherwise use the
* folder where the DLL is as FONTCONFIG_PATH.
*/
- p = strrchr (fontconfig_path, '\\');
+ p = (FcChar8 *) strrchr ((const char *) fontconfig_path, '\\');
if (p)
{
*p = '\0';
- p = strrchr (fontconfig_path, '\\');
- if (p && (FcStrCmpIgnoreCase (p + 1, "bin") == 0 ||
- FcStrCmpIgnoreCase (p + 1, "lib") == 0))
+ p = (FcChar8 *) strrchr ((const char *) fontconfig_path, '\\');
+ if (p && (FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "bin") == 0 ||
+ FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "lib") == 0))
*p = '\0';
- strcat (fontconfig_path, "\\etc\\fonts");
+ strcat ((char *) fontconfig_path, "\\etc\\fonts");
}
else
fontconfig_path[0] = '\0';
@@ -1804,11 +1804,11 @@ FcConfigGetPath (void)
if (fontconfig_path[0] == '\0')
{
char *p;
- if(!GetModuleFileName(NULL, fontconfig_path, sizeof(fontconfig_path)))
+ if(!GetModuleFileName(NULL, (LPCH) fontconfig_path, sizeof(fontconfig_path)))
goto bail1;
- p = strrchr (fontconfig_path, '\\');
+ p = strrchr ((const char *) fontconfig_path, '\\');
if (p) *p = '\0';
- strcat (fontconfig_path, "\\fonts");
+ strcat ((char *) fontconfig_path, "\\fonts");
}
#endif
dir = (FcChar8 *) FONTCONFIG_PATH;
diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h
index 0444ea926..ca6b4f209 100644
--- a/fontconfig/src/fcint.h
+++ b/fontconfig/src/fcint.h
@@ -56,7 +56,7 @@
#ifdef _WIN32
# ifndef _WIN32_WINNT
-# define _WIN32_WINNT 0x0500
+# define _WIN32_WINNT 0x0500
# endif
# define WIN32_LEAN_AND_MEAN
# define STRICT
diff --git a/fontconfig/src/fcstat.c b/fontconfig/src/fcstat.c
index fd64d5cb3..d8663d036 100644
--- a/fontconfig/src/fcstat.c
+++ b/fontconfig/src/fcstat.c
@@ -82,7 +82,7 @@ FcStat (const FcChar8 *file, struct stat *statb)
char *basename;
DWORD rc;
- if (!GetFileAttributesEx (file, GetFileExInfoStandard, &wfad))
+ if (!GetFileAttributesEx ((LPCSTR) file, GetFileExInfoStandard, &wfad))
return -1;
statb->st_dev = 0;
@@ -91,12 +91,12 @@ FcStat (const FcChar8 *file, struct stat *statb)
* Call GetLongPathName() to get the spelling of the path name as it
* is on disk.
*/
- rc = GetFullPathName (file, sizeof (full_path_name), full_path_name, &basename);
+ rc = GetFullPathName ((LPCSTR) file, sizeof (full_path_name), full_path_name, &basename);
if (rc == 0 || rc > sizeof (full_path_name))
return -1;
rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name));
- statb->st_ino = FcStringHash (full_path_name);
+ statb->st_ino = FcStringHash ((const FcChar8 *) full_path_name);
statb->st_mode = _S_IREAD | _S_IWRITE;
statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6);
@@ -129,8 +129,6 @@ FcStat (const FcChar8 *file, struct stat *statb)
return stat ((char *) file, statb);
}
-#endif
-
/* Adler-32 checksum implementation */
struct Adler32 {
int a;
@@ -238,6 +236,7 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum)
return 0;
}
+#endif /* _WIN32 */
int
FcStatChecksum (const FcChar8 *file, struct stat *statb)
@@ -245,11 +244,16 @@ FcStatChecksum (const FcChar8 *file, struct stat *statb)
if (FcStat (file, statb) == -1)
return -1;
+#ifndef _WIN32
+ /* We have a workaround of the broken stat() in FcStat() for Win32.
+ * No need to do something further more.
+ */
if (FcIsFsMtimeBroken (file))
{
if (FcDirChecksum (file, &statb->st_mtime) == -1)
return -1;
}
+#endif
return 0;
}
@@ -258,7 +262,7 @@ static int
FcFStatFs (int fd, FcStatFS *statb)
{
const char *p = NULL;
- int ret=0;
+ int ret = -1;
FcBool flag = FcFalse;
memset (statb, 0, sizeof (FcStatFS));
diff --git a/fontconfig/src/fcstr.c b/fontconfig/src/fcstr.c
index c446bcd8e..f505ea665 100644
--- a/fontconfig/src/fcstr.c
+++ b/fontconfig/src/fcstr.c
@@ -1052,13 +1052,13 @@ FcStrCanonFilename (const FcChar8 *s)
{
#ifdef _WIN32
FcChar8 full[FC_MAX_FILE_LEN + 2];
- int size = GetFullPathName (s, sizeof (full) -1,
- full, NULL);
+ int size = GetFullPathName ((LPCSTR) s, sizeof (full) -1,
+ (LPSTR) full, NULL);
if (size == 0)
perror ("GetFullPathName");
- FcConvertDosPath (full);
+ FcConvertDosPath ((char *) full);
return FcStrCanonAbsoluteFilename (full);
#else
if (s[0] == '/')
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c
index b8c658d55..643a44f1c 100644
--- a/fontconfig/src/fcxml.c
+++ b/fontconfig/src/fcxml.c
@@ -1886,11 +1886,11 @@ FcParseDir (FcConfigParse *parse)
data = prefix;
}
#ifdef _WIN32
- if (strcmp (data, "CUSTOMFONTDIR") == 0)
+ if (strcmp ((const char *) data, "CUSTOMFONTDIR") == 0)
{
char *p;
data = buffer;
- if (!GetModuleFileName (NULL, buffer, sizeof (buffer) - 20))
+ if (!GetModuleFileName (NULL, (LPCH) buffer, sizeof (buffer) - 20))
{
FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed");
goto bail;
@@ -1905,11 +1905,11 @@ FcParseDir (FcConfigParse *parse)
if (p) *p = '\0';
strcat (data, "\\fonts");
}
- else if (strcmp (data, "APPSHAREFONTDIR") == 0)
+ else if (strcmp ((const char *) data, "APPSHAREFONTDIR") == 0)
{
char *p;
data = buffer;
- if (!GetModuleFileName (NULL, buffer, sizeof (buffer) - 20))
+ if (!GetModuleFileName (NULL, (LPCH) buffer, sizeof (buffer) - 20))
{
FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed");
goto bail;
@@ -1918,17 +1918,17 @@ FcParseDir (FcConfigParse *parse)
if (p) *p = '\0';
strcat (data, "\\..\\share\\fonts");
}
- else if (strcmp (data, "WINDOWSFONTDIR") == 0)
+ else if (strcmp ((const char *) data, "WINDOWSFONTDIR") == 0)
{
int rc;
data = buffer;
- rc = pGetSystemWindowsDirectory (buffer, sizeof (buffer) - 20);
+ rc = pGetSystemWindowsDirectory ((LPSTR) buffer, sizeof (buffer) - 20);
if (rc == 0 || rc > sizeof (buffer) - 20)
{
FcConfigMessage (parse, FcSevereError, "GetSystemWindowsDirectory failed");
goto bail;
}
- if (data [strlen (data) - 1] != '\\')
+ if (data [strlen ((const char *) data) - 1] != '\\')
strcat (data, "\\");
strcat (data, "fonts");
}
@@ -1982,7 +1982,7 @@ FcParseCacheDir (FcConfigParse *parse)
data = prefix;
}
#ifdef _WIN32
- if (strcmp (data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0)
+ if (strcmp ((const char *) data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0)
{
int rc;
FcStrFree (data);
@@ -1993,17 +1993,17 @@ FcParseCacheDir (FcConfigParse *parse)
goto bail;
}
FcMemAlloc (FC_MEM_STRING, 1000);
- rc = GetTempPath (800, data);
+ rc = GetTempPath (800, (LPSTR) data);
if (rc == 0 || rc > 800)
{
FcConfigMessage (parse, FcSevereError, "GetTempPath failed");
goto bail;
}
- if (data [strlen (data) - 1] != '\\')
+ if (data [strlen ((const char *) data) - 1] != '\\')
strcat (data, "\\");
strcat (data, "fontconfig\\cache");
}
- else if (strcmp (data, "LOCAL_APPDATA_FONTCONFIG_CACHE") == 0)
+ else if (strcmp ((const char *) data, "LOCAL_APPDATA_FONTCONFIG_CACHE") == 0)
{
char szFPath[MAX_PATH + 1];
size_t len;
@@ -2023,7 +2023,7 @@ FcParseCacheDir (FcConfigParse *parse)
goto bail;
}
FcMemAlloc (FC_MEM_STRING, len);
- strncpy(data, szFPath, len);
+ strncpy((char *) data, szFPath, len);
}
#endif
if (strlen ((char *) data) == 0)