diff options
Diffstat (limited to 'fontconfig/src')
-rw-r--r-- | fontconfig/src/.gitignore | 4 | ||||
-rw-r--r-- | fontconfig/src/fcatomic.c | 3 | ||||
-rw-r--r-- | fontconfig/src/fccache.c | 1 | ||||
-rw-r--r-- | fontconfig/src/fcint.h | 2 | ||||
-rw-r--r-- | fontconfig/src/fcstat.c | 2 | ||||
-rw-r--r-- | fontconfig/src/fcxml.c | 12 | ||||
-rw-r--r-- | fontconfig/src/makealias.py | 36 | ||||
-rw-r--r-- | fontconfig/src/makefile | 60 |
8 files changed, 114 insertions, 6 deletions
diff --git a/fontconfig/src/.gitignore b/fontconfig/src/.gitignore new file mode 100644 index 000000000..baffcee29 --- /dev/null +++ b/fontconfig/src/.gitignore @@ -0,0 +1,4 @@ +fcalias.h
+fcaliastail.h
+fcftalias.h
+fcftaliastail.h
\ No newline at end of file diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c index 4f6ab01f4..96f01235f 100644 --- a/fontconfig/src/fcatomic.c +++ b/fontconfig/src/fcatomic.c @@ -7,7 +7,7 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the author(s) not be used in + * documentation, and that the name of the author(s) not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. The authors make no * representations about the suitability of this software for any purpose. It @@ -56,6 +56,7 @@ #include <time.h> #ifdef _WIN32 +#undef mkdir #define mkdir(path,mode) _mkdir(path) #endif diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c index 9e582b911..48fdbb55e 100644 --- a/fontconfig/src/fccache.c +++ b/fontconfig/src/fccache.c @@ -803,6 +803,7 @@ bail1: #ifdef _WIN32 +#undef mkdir #define mkdir(path,mode) _mkdir(path) #endif diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h index 3d06fc6eb..8c42ff2d9 100644 --- a/fontconfig/src/fcint.h +++ b/fontconfig/src/fcint.h @@ -55,7 +55,9 @@ #endif #ifdef _WIN32 +# ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0500 +# endif # define WIN32_LEAN_AND_MEAN # define STRICT # include <windows.h> diff --git a/fontconfig/src/fcstat.c b/fontconfig/src/fcstat.c index d8ede597c..fd64d5cb3 100644 --- a/fontconfig/src/fcstat.c +++ b/fontconfig/src/fcstat.c @@ -258,7 +258,7 @@ static int FcFStatFs (int fd, FcStatFS *statb) { const char *p = NULL; - int ret; + int ret=0; FcBool flag = FcFalse; memset (statb, 0, sizeof (FcStatFS)); diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index 5201b3c04..343208617 100644 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -1848,7 +1848,11 @@ FcParseUnary (FcConfigParse *parse, FcOp op) static void FcParseDir (FcConfigParse *parse) { - const FcChar8 *attr, *data; +#ifdef _WIN32 + FcChar8 buffer[MAX_PATH]; +#endif + const FcChar8 *attr; + FcChar8 *data; FcChar8 *prefix = NULL; attr = FcConfigGetAttribute (parse, "prefix"); @@ -1886,7 +1890,7 @@ FcParseDir (FcConfigParse *parse) if (!GetModuleFileName (NULL, buffer, sizeof (buffer) - 20)) { FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed"); - break; + goto bail; } /* * Must use the multi-byte aware function to search @@ -1905,7 +1909,7 @@ FcParseDir (FcConfigParse *parse) if (!GetModuleFileName (NULL, buffer, sizeof (buffer) - 20)) { FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed"); - break; + goto bail; } p = _mbsrchr (data, '\\'); if (p) *p = '\0'; @@ -1919,7 +1923,7 @@ FcParseDir (FcConfigParse *parse) if (rc == 0 || rc > sizeof (buffer) - 20) { FcConfigMessage (parse, FcSevereError, "GetSystemWindowsDirectory failed"); - break; + goto bail; } if (data [strlen (data) - 1] != '\\') strcat (data, "\\"); diff --git a/fontconfig/src/makealias.py b/fontconfig/src/makealias.py new file mode 100644 index 000000000..6afca0901 --- /dev/null +++ b/fontconfig/src/makealias.py @@ -0,0 +1,36 @@ +import sys,os,re,glob + +SRCDIR=sys.argv[1] +HEAD=open(sys.argv[2],"w") +TAIL=open(sys.argv[3],"w") + +#rm -f $HEAD $TAIL +TAIL.write("#if HAVE_GNUC_ATTRIBUTE\n") + +InputFiles=sys.argv[4:] +Names=[] +for Input in InputFiles: + buffer=open(Input,"r").read() + Names.extend(re.findall(r'\n(Fc[^ ]*) *\(',buffer)) + +def SearchCFiles(Name): + Files=glob.glob(os.path.join(SRCDIR,"*.c") ) + for File in Files: + buffer=open(File,"r").read() + res = re.findall(r'\n%s[ \(].*'%Name,buffer) + if res: + File=re.sub(r'^.*[\\/]','',File) + return "__"+re.sub(r'\.c','__',File) + +for Name in Names: + if Name=="FcCacheDir" or Name=="FcCacheSubdir": + continue + + alias="IA__"+Name + HEAD.write("extern __typeof (%s) %s;\n"%(Name,alias)) + HEAD.write("#define %s %s\n"%(Name,alias)) + TAIL.write("#ifdef "+SearchCFiles(Name)+"\n") + TAIL.write("#undef %s\n"%Name) + TAIL.write("extern __typeof (%s) %s;\n"%(Name,Name)) + TAIL.write("#endif\n") +TAIL.write("#endif\n") diff --git a/fontconfig/src/makefile b/fontconfig/src/makefile new file mode 100644 index 000000000..a289c5f6e --- /dev/null +++ b/fontconfig/src/makefile @@ -0,0 +1,60 @@ + +#INCLUDES = \ +# -I$(top_srcdir) \ +# -I$(top_srcdir)/src \ +# $(FREETYPE_CFLAGS) \ +# $(LIBXML2_CFLAGS) \ +# $(EXPAT_CFLAGS) \ +# $(WARN_CFLAGS) \ +# -DFC_CACHEDIR='"$(FC_CACHEDIR)"' \ +# -DFONTCONFIG_PATH='"$(CONFDIR)"' + +load_makefile NORELDBG=1 ..\fc-case\makefile +load_makefile NORELDBG=1 ..\fc-glyphname\makefile +load_makefile NORELDBG=1 ..\fc-lang\makefile + +CSRCS = \ + fcatomic.c \ + fcblanks.c \ + fccache.c \ + fccfg.c \ + fccharset.c \ + fcdbg.c \ + fcdefault.c \ + fcdir.c \ + fcformat.c \ + fcfreetype.c \ + fcfs.c \ + fcinit.c \ + fclang.c \ + fclist.c \ + fcmatch.c \ + fcmatrix.c \ + fcname.c \ + fcpat.c \ + fcserialize.c \ + fcstat.c \ + fcstr.c \ + fcxml.c \ + \ + ftglue.c + +LIBRARY = libfontconfig + +PUBLIC_FILES = \ + ..\fontconfig\fontconfig.h \ + fcdeprecate.h \ + ..\fontconfig\fcprivate.h + +PUBLIC_FT_FILES = \ + ..\fontconfig\fcfreetype.h + +DEFINES += FC_CACHEDIR="""getenv(\"""TEMP\""")""" FC_DEFAULT_FONTS="""WINDOWSFONTDIR""" +INCLUDES := .. $(INCLUDES) $(MHMAKECONF)\freetype\include $(MHMAKECONF)\libxml2\include $(MHMAKECONF)\iconv\include + +fcalias.h fcaliastail.h: makealias.py $(PUBLIC_FILES) + python makealias.py . fcalias.h fcaliastail.h $(PUBLIC_FILES) + +fcftalias.h fcftaliastail.h: makealias.py $(PUBLIC_FT_FILES) + python makealias.py . fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES) + |