aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig/src')
-rw-r--r--fontconfig/src/.gitignore4
-rw-r--r--fontconfig/src/cleangperf.py8
-rw-r--r--fontconfig/src/fcatomic.c2
-rw-r--r--fontconfig/src/fccompat.c2
-rw-r--r--fontconfig/src/fcfreetype.c8
-rw-r--r--fontconfig/src/fclist.c2
-rw-r--r--fontconfig/src/fcstat.c2
-rw-r--r--fontconfig/src/fcstdint.h2
-rw-r--r--fontconfig/src/fcxml.c3
-rw-r--r--fontconfig/src/makealias.py36
-rw-r--r--fontconfig/src/makefile62
11 files changed, 122 insertions, 9 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/cleangperf.py b/fontconfig/src/cleangperf.py
new file mode 100644
index 000000000..a276312c9
--- /dev/null
+++ b/fontconfig/src/cleangperf.py
@@ -0,0 +1,8 @@
+import sys,re
+
+inbuffer=sys.stdin.read()
+inbuffer=re.sub(r'[ \t\r\n]*\n[ \t]*',r'\n',inbuffer)
+inbuffer=re.sub(r'[ \t\r\n]*,[ \t\r\n]',r',',inbuffer)
+inbuffer=re.sub(r'\n#[^\n]+','',inbuffer)
+sys.stdout.write(inbuffer)
+
diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c
index c1daed938..c35a829fd 100644
--- a/fontconfig/src/fcatomic.c
+++ b/fontconfig/src/fcatomic.c
@@ -55,7 +55,7 @@
#include <time.h>
#ifdef _WIN32
-#include <direct.h>
+#undef mkdir
#define mkdir(path,mode) _mkdir(path)
#endif
diff --git a/fontconfig/src/fccompat.c b/fontconfig/src/fccompat.c
index 1c2ba8bed..b685fade3 100644
--- a/fontconfig/src/fccompat.c
+++ b/fontconfig/src/fccompat.c
@@ -217,7 +217,7 @@ FcRandom(void)
}
#ifdef _WIN32
-#include <direct.h>
+#undef mkdir
#define mkdir(path,mode) _mkdir(path)
#endif
diff --git a/fontconfig/src/fcfreetype.c b/fontconfig/src/fcfreetype.c
index e39430762..056e0f6b5 100644
--- a/fontconfig/src/fcfreetype.c
+++ b/fontconfig/src/fcfreetype.c
@@ -2652,10 +2652,10 @@ addtag(FcChar8 *complex_, FT_ULong tag)
{
FcChar8 tagstring[OTLAYOUT_ID_LEN + 1];
- tagstring[0] = (FcChar8)(tag >> 24),
- tagstring[1] = (FcChar8)(tag >> 16),
- tagstring[2] = (FcChar8)(tag >> 8),
- tagstring[3] = (FcChar8)(tag);
+ tagstring[0] = (FcChar8)((tag >> 24)&0xff),
+ tagstring[1] = (FcChar8)((tag >> 16)&0xff),
+ tagstring[2] = (FcChar8)((tag >> 8)&0xff),
+ tagstring[3] = (FcChar8)((tag)&0xff);
tagstring[4] = '\0';
/* skip tags which aren't alphanumeric, under the assumption that
diff --git a/fontconfig/src/fclist.c b/fontconfig/src/fclist.c
index a365098a4..e58a62b9f 100644
--- a/fontconfig/src/fclist.c
+++ b/fontconfig/src/fclist.c
@@ -80,7 +80,7 @@ FcObjectSetAdd (FcObjectSet *os, const char *object)
}
if (c < 0)
mid++;
- memmove (os->objects + mid + 1, os->objects + mid,
+ memmove ((void*)(os->objects + mid + 1), os->objects + mid,
(os->nobject - mid) * sizeof (const char *));
os->objects[mid] = object;
os->nobject++;
diff --git a/fontconfig/src/fcstat.c b/fontconfig/src/fcstat.c
index ff8e88455..1f37cacf8 100644
--- a/fontconfig/src/fcstat.c
+++ b/fontconfig/src/fcstat.c
@@ -90,7 +90,7 @@ FcStat (const FcChar8 *file, struct stat *statb)
return -1;
rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name));
- statb->st_ino = FcStringHash ((const FcChar8 *) full_path_name);
+ statb->st_ino = FcStringHash ((const FcChar8 *) full_path_name)&0xffff;
statb->st_mode = _S_IREAD | _S_IWRITE;
statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6);
diff --git a/fontconfig/src/fcstdint.h b/fontconfig/src/fcstdint.h
new file mode 100644
index 000000000..31da039d9
--- /dev/null
+++ b/fontconfig/src/fcstdint.h
@@ -0,0 +1,2 @@
+#include <stdint.h>
+
diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c
index bd95580aa..da9cb5ddc 100644
--- a/fontconfig/src/fcxml.c
+++ b/fontconfig/src/fcxml.c
@@ -1988,7 +1988,8 @@ FcParseUnary (FcConfigParse *parse, FcOp op)
static void
FcParseDir (FcConfigParse *parse)
{
- const FcChar8 *attr, *data;
+ const FcChar8 *attr;
+ FcChar8 *data;
FcChar8 *prefix = NULL, *p;
#ifdef _WIN32
FcChar8 buffer[1000];
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..189478427
--- /dev/null
+++ b/fontconfig/src/makefile
@@ -0,0 +1,62 @@
+$(OBJDIR)\fcobjshash.gperf: fcobjshash.gperf.h fcobjs.h
+ cp $< $<.c
+ $(CPP) -EP -I.. $<.c | \
+ python cleangperf.py | \
+ gawk '/CUT_OUT_BEGIN/ { no_write=1; next; }; /CUT_OUT_END/ { no_write=0; next; }; { if (!no_write) print; next; };' - > $@.tmp
+ mv -f $@.tmp $@
+ rm $<.c
+
+$(OBJDIR)\fcobjshash.h: $(OBJDIR)\fcobjshash.gperf
+ gperf -m 100 $< > $@
+
+
+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 \
+ fccompat.c \
+ fcdbg.c \
+ fcdefault.c \
+ fcdir.c \
+ fcformat.c \
+ fcfreetype.c \
+ fcfs.c \
+ fchash.c \
+ fcinit.c \
+ fclang.c \
+ fclist.c \
+ fcmatch.c \
+ fcmatrix.c \
+ fcname.c \
+ fcobjs.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
+
+INCLUDES := .. $(OBJDIR) $(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)
+