diff options
Diffstat (limited to 'mkfontscale')
-rw-r--r-- | mkfontscale/config.h | 6 | ||||
-rw-r--r-- | mkfontscale/hash.c | 7 | ||||
-rw-r--r-- | mkfontscale/hash.h | 4 | ||||
-rw-r--r-- | mkfontscale/ident.c | 1 | ||||
-rw-r--r-- | mkfontscale/makefile | 23 | ||||
-rw-r--r-- | mkfontscale/mkfontscale.c | 14 |
6 files changed, 49 insertions, 6 deletions
diff --git a/mkfontscale/config.h b/mkfontscale/config.h new file mode 100644 index 000000000..668a42e82 --- /dev/null +++ b/mkfontscale/config.h @@ -0,0 +1,6 @@ +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +#define PACKAGE_STRING "mkfontscale" + +#endif diff --git a/mkfontscale/hash.c b/mkfontscale/hash.c index d83422278..adf59412b 100644 --- a/mkfontscale/hash.c +++ b/mkfontscale/hash.c @@ -25,6 +25,7 @@ #endif #include <stdlib.h> +#include <unistd.h> #include <stdio.h> #include <string.h> #include <ctype.h> @@ -152,7 +153,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); @@ -161,7 +163,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 da93e0c0d..fcb5931f7 100644 --- a/mkfontscale/mkfontscale.c +++ b/mkfontscale/mkfontscale.c @@ -26,7 +26,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> @@ -117,7 +121,7 @@ static char *encodingPrefix; static char *exclusionSuffix; static char *ProgramName; -static void _X_NORETURN _X_COLD +static void usage(void) { fprintf(stderr, "Usage:\n" @@ -128,7 +132,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); @@ -157,9 +161,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; @@ -865,10 +869,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 ; |