summaryrefslogtreecommitdiff
path: root/Build/source/texk/lcdf-typetools/lcdf-typetools-2.99-PATCHES/patch-30-W32TeX
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/lcdf-typetools/lcdf-typetools-2.99-PATCHES/patch-30-W32TeX')
-rw-r--r--Build/source/texk/lcdf-typetools/lcdf-typetools-2.99-PATCHES/patch-30-W32TeX304
1 files changed, 47 insertions, 257 deletions
diff --git a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.99-PATCHES/patch-30-W32TeX b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.99-PATCHES/patch-30-W32TeX
index bddeaacd6c3..26c6df2aca7 100644
--- a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.99-PATCHES/patch-30-W32TeX
+++ b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.99-PATCHES/patch-30-W32TeX
@@ -1,7 +1,18 @@
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.99.orig/otftotfm/automatic.cc lcdf-typetools-2.99/otftotfm/automatic.cc
--- lcdf-typetools-2.99.orig/otftotfm/automatic.cc 2013-09-10 11:05:27.000000000 +0200
-+++ lcdf-typetools-2.99/otftotfm/automatic.cc 2013-09-10 11:06:31.000000000 +0200
-@@ -124,7 +124,18 @@
++++ lcdf-typetools-2.99/otftotfm/automatic.cc 2013-09-10 19:13:50.000000000 +0200
+@@ -39,6 +39,10 @@
+ #include <algorithm>
+
+ #ifdef WIN32
++#ifdef _MSC_VER
++# include <io.h>
++# include <direct.h>
++#endif
+ # define mkdir(dir, access) mkdir(dir)
+ # define COPY_CMD "copy"
+ # define CMD_SEP "&"
+@@ -124,7 +128,18 @@
static void
find_writable_texdir(ErrorHandler *errh, const char *)
{
@@ -20,7 +31,7 @@ diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetoo
if (!writable_texdir)
look_for_writable_texdir("$VARTEXMF", false);
if (!writable_texdir)
-@@ -745,6 +756,14 @@
+@@ -745,6 +760,14 @@
int slash = filename.find_right('\'');
if (slash >= 0)
filename = filename.substring(slash + 1);
@@ -36,211 +47,39 @@ diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetoo
if (verbose)
command += " 1>&2";
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.99.orig/otftotfm/kpseinterface.c lcdf-typetools-2.99/otftotfm/kpseinterface.c
---- lcdf-typetools-2.99.orig/otftotfm/kpseinterface.c 2013-08-13 22:18:57.000000000 +0200
-+++ lcdf-typetools-2.99/otftotfm/kpseinterface.c 2013-09-10 11:06:31.000000000 +0200
-@@ -11,24 +11,112 @@
- * Public License for more details.
- */
-
-+/* The W32TEX version does not link to Kpathsea, but uses the DLL
-+ * built by MSVC.
-+ */
-+
-+#if !defined(W32TEX)
- #include <kpathsea/config.h>
-+#endif
- #ifdef HAVE_CONFIG_H
- # include <config.h>
- #endif
- #include <stdio.h>
- #include <stdlib.h>
-+#ifdef W32TEX
-+#define ENV_SEP ';'
-+#include <windows.h>
-+extern HINSTANCE Hinstance;
-+#else
- #include <kpathsea/progname.h>
+--- lcdf-typetools-2.99.orig/otftotfm/kpseinterface.c 2013-09-11 08:54:18.000000000 +0200
++++ lcdf-typetools-2.99/otftotfm/kpseinterface.c 2013-09-11 09:02:02.000000000 +0200
+@@ -21,6 +21,9 @@
#include <kpathsea/expand.h>
#include <kpathsea/c-pathch.h>
#include <kpathsea/tex-file.h>
++#ifdef W32TEX
++#include <kpathsea/variable.h>
+#endif
#include "kpseinterface.h"
int kpsei_env_sep_char = ENV_SEP;
-
-+#ifdef W32TEX
-+typedef enum
-+{
-+ kpse_gf_format,
-+ kpse_pk_format,
-+ kpse_any_glyph_format, /* ``any'' meaning gf or pk */
-+ kpse_tfm_format,
-+ kpse_afm_format,
-+ kpse_base_format,
-+ kpse_bib_format,
-+ kpse_bst_format,
-+ kpse_cnf_format,
-+ kpse_db_format,
-+ kpse_fmt_format,
-+ kpse_fontmap_format,
-+ kpse_mem_format,
-+ kpse_mf_format,
-+ kpse_mfpool_format,
-+ kpse_mft_format,
-+ kpse_mp_format,
-+ kpse_mppool_format,
-+ kpse_mpsupport_format,
-+ kpse_ocp_format,
-+ kpse_ofm_format,
-+ kpse_opl_format,
-+ kpse_otp_format,
-+ kpse_ovf_format,
-+ kpse_ovp_format,
-+ kpse_pict_format,
-+ kpse_tex_format,
-+ kpse_texdoc_format,
-+ kpse_texpool_format,
-+ kpse_texsource_format,
-+ kpse_tex_ps_header_format,
-+ kpse_troff_font_format,
-+ kpse_type1_format,
-+ kpse_vf_format,
-+ kpse_dvips_config_format,
-+ kpse_ist_format,
-+ kpse_truetype_format,
-+ kpse_type42_format,
-+ kpse_web2c_format,
-+ kpse_program_text_format,
-+ kpse_program_binary_format,
-+ kpse_miscfonts_format,
-+ kpse_web_format,
-+ kpse_cweb_format,
-+ kpse_enc_format,
-+ kpse_cmap_format,
-+ kpse_sfd_format,
-+ kpse_opentype_format,
-+ kpse_pdftex_config_format,
-+ kpse_lig_format,
-+ kpse_texmfscripts_format,
-+ kpse_lua_format,
-+ kpse_fea_format,
-+ kpse_cid_format,
-+ kpse_mlbib_format,
-+ kpse_mlbst_format,
-+ kpse_clua_format,
-+ kpse_ris_format,
-+ kpse_bltxml_format,
-+ kpse_last_format /* one past last index */
-+} kpse_file_format_type;
-+#endif
-+
- void
- kpsei_init(const char* argv0, const char* progname)
+@@ -86,3 +89,11 @@
{
-+#ifdef W32TEX
-+ PROC pkpse_set_program_name;
-+ pkpse_set_program_name = GetProcAddress(Hinstance, "kpse_set_program_name");
-+ if(!pkpse_set_program_name) {
-+ fprintf(stderr, "Failed to find Kpathsea function.\n");
-+ return;
-+ }
-+ (void)pkpse_set_program_name(argv0, progname);
-+#else
- kpse_set_program_name(argv0, progname);
-+#endif
- #ifdef SELFAUTODIR
- putenv("SELFAUTODIR=" SELFAUTODIR);
- #endif
-@@ -43,13 +131,35 @@
- char*
- kpsei_path_expand(const char* path)
- {
-+#ifdef W32TEX
-+ PROC pkpse_path_expand;
-+ pkpse_path_expand = GetProcAddress(Hinstance, "kpse_path_expand");
-+ if(!pkpse_path_expand) {
-+ fprintf(stderr, "Failed to find Kpathsea function.\n");
-+ return 0;
-+ }
-+ return (char *)pkpse_path_expand(path);
-+#else
- return kpse_path_expand(path);
-+#endif
- }
-
-+#ifdef W32TEX
-+#define kpse_find_file (char *)pkpse_find_file
-+#endif
-+
- char*
- kpsei_find_file(const char* name, int format)
- {
- char *result;
-+#ifdef W32TEX
-+ PROC pkpse_find_file;
-+ pkpse_find_file = GetProcAddress(Hinstance, "kpse_find_file");
-+ if(!pkpse_find_file) {
-+ fprintf(stderr, "Failed to find Kpathsea function.\n");
-+ return 0;
-+ }
-+#endif
- switch (format) {
- case KPSEI_FMT_WEB2C:
- return kpse_find_file(name, kpse_web2c_format, true);
-@@ -81,5 +191,41 @@
- void
- kpsei_set_debug_flags(unsigned flags)
- {
-+#ifdef W32TEX
-+ unsigned int *pkpathsea_debug;
-+ pkpathsea_debug = (unsigned int *)GetProcAddress(Hinstance, "kpathsea_debug");
-+ if(!pkpathsea_debug) {
-+ fprintf(stderr, "Failed to find Kpathsea variable.\n");
-+ return;
-+ }
-+ *pkpathsea_debug = flags;
-+#else
kpathsea_debug = flags;
-+#endif
-+}
-+
-+#ifdef W32TEX
-+int
-+kpsei_getlongpath(char *buff, char *input, int len)
-+{
-+ PROC pkpse_getlongpath;
-+ pkpse_getlongpath = GetProcAddress(Hinstance, "getlongpath");
-+ if(!pkpse_getlongpath) {
-+ fprintf(stderr, "Failed to find Kpathsea function.\n");
-+ return 0;
-+ }
-+ return (int)pkpse_getlongpath(buff, input, len);
}
+
-+char *
-+kpsei_var_value(const char *var)
++#ifdef W32TEX
++char*
++kpsei_var_value(const char *name)
+{
-+ PROC pkpse_var_value;
-+ pkpse_var_value = GetProcAddress(Hinstance, "kpse_var_value");
-+ if(!pkpse_var_value) {
-+ fprintf(stderr, "Failed to find Kpathsea function.\n");
-+ return NULL;
-+ }
-+ return (char *)pkpse_var_value(var);
++ return kpse_var_value(name);
+}
+#endif
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.99.orig/otftotfm/kpseinterface.h lcdf-typetools-2.99/otftotfm/kpseinterface.h
--- lcdf-typetools-2.99.orig/otftotfm/kpseinterface.h 2013-08-13 22:12:16.000000000 +0200
-+++ lcdf-typetools-2.99/otftotfm/kpseinterface.h 2013-09-10 11:06:31.000000000 +0200
-@@ -13,6 +13,13 @@
++++ lcdf-typetools-2.99/otftotfm/kpseinterface.h 2013-09-10 19:13:50.000000000 +0200
+@@ -13,6 +13,10 @@
char* kpsei_find_file(const char* name, int format);
void kpsei_set_debug_flags(unsigned flags);
+#ifdef W32TEX
-+int kpsei_getlongpath(char *buff, char *input, int len);
-+char *kpsei_var_value(const char *var);
-+#define true 1
-+#define false 0
++char* kpsei_var_value(const char *name);
+#endif
+
#ifdef __cplusplus
@@ -248,78 +87,29 @@ diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetoo
#endif
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.99.orig/otftotfm/otftotfm.cc lcdf-typetools-2.99/otftotfm/otftotfm.cc
--- lcdf-typetools-2.99.orig/otftotfm/otftotfm.cc 2013-09-10 11:00:57.000000000 +0200
-+++ lcdf-typetools-2.99/otftotfm/otftotfm.cc 2013-09-10 11:06:31.000000000 +0200
-@@ -1739,6 +1739,11 @@
- }
- }
-
-+#ifdef W32TEX
-+#include <windows.h>
-+HINSTANCE Hinstance;
-+#endif
-+
- int
- main(int argc, char *argv[])
- {
-@@ -1750,6 +1755,15 @@
- Clp_AddType(clp, CHAR_OPTTYPE, 0, clp_parse_char, 0);
- program_name = Clp_ProgramName(clp);
- #if HAVE_KPATHSEA
-+#ifdef W32TEX
-+ Hinstance = LoadLibrary(KPSEDLLNAME);
-+ if(Hinstance == NULL)
-+ Hinstance = LoadLibrary(KPSEOLDDLLNAME);
-+ if(Hinstance == NULL) {
-+ fprintf(stderr, "I cannot load Kpathsea dynamic library.\n");
-+ return 100;
-+ }
-+#endif
- kpsei_init(argv[0], "lcdftools");
++++ lcdf-typetools-2.99/otftotfm/otftotfm.cc 2013-09-10 19:13:50.000000000 +0200
+@@ -63,6 +63,10 @@
+ #ifdef HAVE_FCNTL_H
+ # include <fcntl.h>
#endif
- #ifdef HAVE_CTIME
-@@ -2121,11 +2135,19 @@
- This is free software; see the source for copying conditions.\n\
- There is NO warranty, not even for merchantability or fitness for a\n\
- particular purpose.\n");
-+#ifdef W32TEX
-+ if(Hinstance != NULL)
-+ FreeLibrary(Hinstance);
++#ifdef _MSC_VER
++# include <io.h>
++#undef max
+#endif
- exit(0);
- break;
- case HELP_OPT:
- usage();
-+#ifdef W32TEX
-+ if(Hinstance != NULL)
-+ FreeLibrary(Hinstance);
-+#endif
- exit(0);
- break;
+ using namespace Efont;
-@@ -2181,8 +2203,13 @@
- try {
- // read font
- otf_data = read_file(input_file, errh);
-- if (errh->nerrors())
-+ if (errh->nerrors()) {
-+#ifdef W32TEX
-+ if(Hinstance != NULL)
-+ FreeLibrary(Hinstance);
+diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.99.orig/otftotfm/secondary.cc lcdf-typetools-2.99/otftotfm/secondary.cc
+--- lcdf-typetools-2.99.orig/otftotfm/secondary.cc 2013-08-13 22:18:57.000000000 +0200
++++ lcdf-typetools-2.99/otftotfm/secondary.cc 2013-09-10 19:13:50.000000000 +0200
+@@ -31,6 +31,10 @@
+ #include <errno.h>
+ #include <limits.h>
+ #include <algorithm>
++#ifdef _MSC_VER
++#undef max
++#undef min
+#endif
- exit(1);
-+ }
- LandmarkErrorHandler cerrh(errh, printable_filename(input_file));
- BailErrorHandler bail_errh(&cerrh);
-@@ -2271,6 +2298,10 @@
- } catch (OpenType::Error e) {
- errh->error("unhandled exception %<%s%>", e.description.c_str());
- }
-+#ifdef W32TEX
-+ if(Hinstance != NULL)
-+ FreeLibrary(Hinstance);
-+#endif
-
- return (errh->nerrors() == 0 ? 0 : 1);
- }
+ enum {
+ U_EXCLAMDOWN = 0x00A1, // U+00A1 INVERTED EXCLAMATION MARK