aboutsummaryrefslogtreecommitdiff
path: root/mkfontscale
diff options
context:
space:
mode:
Diffstat (limited to 'mkfontscale')
-rw-r--r--mkfontscale/hash.c7
-rw-r--r--mkfontscale/hash.h4
-rw-r--r--mkfontscale/ident.c1
-rw-r--r--mkfontscale/makefile23
-rw-r--r--mkfontscale/mkfontscale.c14
5 files changed, 43 insertions, 6 deletions
diff --git a/mkfontscale/hash.c b/mkfontscale/hash.c
index 3adfb6861..58f1b6940 100644
--- a/mkfontscale/hash.c
+++ b/mkfontscale/hash.c
@@ -23,6 +23,7 @@
#include "config.h"
#include <stdlib.h>
+#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
@@ -150,7 +151,8 @@ hashElements(HashTablePtr table)
static int
key_first_cmp(const void *v1, const void *v2)
{
- const HashBucketPtr *b1 = v1, *b2 = v2;
+ const HashBucketPtr *b1 = (const HashBucketPtr *)v1;
+ const HashBucketPtr *b2 = (const HashBucketPtr *)v2;
int c1 = strcasecmp((*b1)->key, (*b2)->key);
if(c1 != 0) return c1;
return strcmp((*b1)->value, (*b2)->value);
@@ -159,7 +161,8 @@ key_first_cmp(const void *v1, const void *v2)
static int
value_first_cmp(const void *v1, const void *v2)
{
- const HashBucketPtr *b1 = v1, *b2 = v2;
+ const HashBucketPtr *b1 = (const HashBucketPtr *)v1;
+ const HashBucketPtr *b2 = (const HashBucketPtr *)v2;
int c1 = strcmp((*b1)->value, (*b2)->value);
if(c1 != 0) return c1;
return strcasecmp((*b1)->key, (*b2)->key);
diff --git a/mkfontscale/hash.h b/mkfontscale/hash.h
index 9aa94a6cb..df0feeb71 100644
--- a/mkfontscale/hash.h
+++ b/mkfontscale/hash.h
@@ -23,6 +23,10 @@
#ifndef _MKS_HASH_H_
#define _MKS_HASH_H_ 1
+#ifdef _MSC_VER
+#define strcasecmp _stricmp
+#endif
+
typedef struct _HashBucket {
char *key;
char *value;
diff --git a/mkfontscale/ident.c b/mkfontscale/ident.c
index 22d364830..a3af2033f 100644
--- a/mkfontscale/ident.c
+++ b/mkfontscale/ident.c
@@ -52,6 +52,7 @@
#endif
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include "zlib.h"
#include "ident.h"
diff --git a/mkfontscale/makefile b/mkfontscale/makefile
new file mode 100644
index 000000000..8373534e0
--- /dev/null
+++ b/mkfontscale/makefile
@@ -0,0 +1,23 @@
+TTYAPP = mkfontscale
+
+DEFINES += _BSD_SOURCE
+
+INCLUDES += $(MHMAKECONF)\freetype\include
+
+INCLUDELIBFILES = \
+ $(MHMAKECONF)\zlib\$(OBJDIR)\zlib1.lib \
+ $(MHMAKECONF)\libXfont\src\fontfile\$(OBJDIR)\libfontfile.lib \
+ $(MHMAKECONF)\libXfont\src\util\$(OBJDIR)\libutil.lib \
+ $(MHMAKECONF)\libfontenc\src\$(OBJDIR)\libfontenc.lib
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+CSRCS = hash.c \
+ ident.c \
+ list.c \
+ mkfontscale.c
+
+LINKLIBS += $(FREETYPELIB)
+
diff --git a/mkfontscale/mkfontscale.c b/mkfontscale/mkfontscale.c
index a494f931d..b01d80a27 100644
--- a/mkfontscale/mkfontscale.c
+++ b/mkfontscale/mkfontscale.c
@@ -24,7 +24,11 @@
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
+#ifdef _MSC_VER
+#include <direct.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
@@ -115,7 +119,7 @@ static char *encodingPrefix;
static char *exclusionSuffix;
static char *ProgramName;
-static void _X_NORETURN _X_COLD
+static void
usage(void)
{
fprintf(stderr, "Usage:\n"
@@ -126,7 +130,7 @@ usage(void)
exit(1);
}
-static void _X_NORETURN _X_COLD
+static void
missing_arg (const char *option)
{
fprintf(stderr, "%s: %s requires an argument\n", ProgramName, option);
@@ -155,9 +159,9 @@ main(int argc, char **argv)
outfilename = NULL;
- encodings = makeList(encodings_array, countof(encodings_array), NULL, 0);
+ encodings = makeList((char **)encodings_array, countof(encodings_array), NULL, 0);
- extra_encodings = makeList(extra_encodings_array,
+ extra_encodings = makeList((char**)extra_encodings_array,
countof(extra_encodings_array),
NULL, 0);
doBitmaps = 0;
@@ -859,10 +863,12 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
#endif
#ifdef S_ISLNK
{
+#ifndef WIN32
if (lstat(filename, &f_stat))
goto done;
if (S_ISLNK(f_stat.st_mode))
tprio = 0;
+#endif
}
#else
;