summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakuji Tanaka <ttk@t-lab.opal.ne.jp>2023-08-11 11:46:06 +0000
committerTakuji Tanaka <ttk@t-lab.opal.ne.jp>2023-08-11 11:46:06 +0000
commitc5e4e0be5fc1f094bb643e2d8a96e9419c70d674 (patch)
treec1a41c1892d48acfce85046f3ce59da0edd043f0
parentac43529ce20ed19128087d7299fad0f492058a6c (diff)
dvi2tty: Enable to build with MSVC on Windows
git-svn-id: svn://tug.org/texlive/trunk@67876 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dvi2tty/ChangeLog7
-rwxr-xr-xBuild/source/texk/dvi2tty/disdvi.test14
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h7
-rwxr-xr-xBuild/source/texk/dvi2tty/dvi2tty.test55
4 files changed, 51 insertions, 32 deletions
diff --git a/Build/source/texk/dvi2tty/ChangeLog b/Build/source/texk/dvi2tty/ChangeLog
index f2235d461d1..f8808dd1efe 100644
--- a/Build/source/texk/dvi2tty/ChangeLog
+++ b/Build/source/texk/dvi2tty/ChangeLog
@@ -1,3 +1,10 @@
+2023-08-11 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * dvi2tty.h:
+ Enable to build with MS Visual C on Windows.
+ * dvi2tty.test, disdvi.test:
+ Make easier to test on Windows.
+
2022-05-01 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
dvi2tty-6.0.2.
diff --git a/Build/source/texk/dvi2tty/disdvi.test b/Build/source/texk/dvi2tty/disdvi.test
index 73cd74cf671..30fbe6d0527 100755
--- a/Build/source/texk/dvi2tty/disdvi.test
+++ b/Build/source/texk/dvi2tty/disdvi.test
@@ -4,23 +4,27 @@
# Copyright 2012 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_disdvi=$BinDir/disdvi$ExeExt
+
test_src=$srcdir/$DVI2TTY_TREE/test
test_out=$srcdir/output
rm -f *.dout
rc=0
-./disdvi $test_src/ligtest >ligtest.dout \
+$_disdvi $test_src/ligtest >ligtest.dout \
&& diff $test_out/ligtest.dis ligtest.dout \
|| rc=1
-./disdvi $test_src/ptex1.dvi >ptex1.dout \
+$_disdvi $test_src/ptex1.dvi >ptex1.dout \
&& diff $test_out/ptex1.dis ptex1.dout || rc=2
-./disdvi $test_src/uptex1.dvi >uptex1.dout \
+$_disdvi $test_src/uptex1.dvi >uptex1.dout \
&& diff $test_out/uptex1.dis uptex1.dout || rc=3
-./disdvi -p -Eu $test_src/ptex2.dvi >ptex2Eu.dout \
+$_disdvi -p -Eu $test_src/ptex2.dvi >ptex2Eu.dout \
&& diff $test_out/ptex2Eu.dis ptex2Eu.dout || rc=9
-./disdvi -u -Eu $test_src/uptex2.dvi >uptex2Eu.dout \
+$_disdvi -u -Eu $test_src/uptex2.dvi >uptex2Eu.dout \
&& diff $test_out/uptex2Eu.dis uptex2Eu.dout || rc=10
diff --git a/Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h b/Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h
index ddd92563217..23a8f1e19f1 100644
--- a/Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h
+++ b/Build/source/texk/dvi2tty/dvi2tty-src/dvi2tty.h
@@ -40,8 +40,13 @@ Copyright (C) 1989-2010 M.J.E. Mol, MESA Consulting B.V."
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
#if (defined(WIN32) && !defined(__MINGW32__))
-# include <malloc.h>
+# include <fcntl.h>
+typedef void *HANDLE;
+typedef unsigned long DWORD;
+#define STD_OUTPUT_HANDLE ((DWORD)-11)
+#define STD_ERROR_HANDLE ((DWORD)-12)
#endif
#define nil NULL
diff --git a/Build/source/texk/dvi2tty/dvi2tty.test b/Build/source/texk/dvi2tty/dvi2tty.test
index 33f884f5b02..620c072de44 100755
--- a/Build/source/texk/dvi2tty/dvi2tty.test
+++ b/Build/source/texk/dvi2tty/dvi2tty.test
@@ -4,6 +4,10 @@
# Copyright 2010-2012 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_dvi2tty=$BinDir/dvi2tty$ExeExt
+
test_src=$srcdir/$DVI2TTY_TREE/test
test_out=$srcdir/output
@@ -12,43 +16,42 @@ unset DVI2TTY # nullify dvi2tty options (if any)
rm -f *.out
rc=0
-./dvi2tty $test_src/test.dvi >test.out && diff $test_out/test.tty test.out || rc=1
-./dvi2tty -c $test_src/test.dvi >testc.out && diff $test_out/testc.tty testc.out || rc=2
-./dvi2tty -s $test_src/test.dvi >tests.out && diff $test_out/tests.tty tests.out || rc=3
-./dvi2tty -u $test_src/test.dvi >testu.out && diff $test_out/testu.tty testu.out || rc=4
-./dvi2tty -Eu $test_src/test.dvi >testEu.out && diff $test_out/testEu.tty testEu.out || rc=6
+$_dvi2tty $test_src/test.dvi >test.out && diff $test_out/test.tty test.out || rc=1
+$_dvi2tty -c $test_src/test.dvi >testc.out && diff $test_out/testc.tty testc.out || rc=2
+$_dvi2tty -s $test_src/test.dvi >tests.out && diff $test_out/tests.tty tests.out || rc=3
+$_dvi2tty -u $test_src/test.dvi >testu.out && diff $test_out/testu.tty testu.out || rc=4
+$_dvi2tty -Eu $test_src/test.dvi >testEu.out && diff $test_out/testEu.tty testEu.out || rc=6
-./dvi2tty $test_src/ligtest >ligtest.out && diff $test_out/ligtest.tty ligtest.out || rc=11
-./dvi2tty -u $test_src/ligtest >ligtestu.out && diff $test_out/ligtestu.tty ligtestu.out || rc=14
-./dvi2tty -Eu $test_src/ligtest >ligtestEu.out && diff $test_out/ligtestEu.tty ligtestEu.out || rc=16
+$_dvi2tty $test_src/ligtest >ligtest.out && diff $test_out/ligtest.tty ligtest.out || rc=11
+$_dvi2tty -u $test_src/ligtest >ligtestu.out && diff $test_out/ligtestu.tty ligtestu.out || rc=14
+$_dvi2tty -Eu $test_src/ligtest >ligtestEu.out && diff $test_out/ligtestEu.tty ligtestEu.out || rc=16
-./dvi2tty $test_src/table.dvi >table.out && diff $test_out/table.tty table.out || rc=21
-./dvi2tty -c $test_src/table.dvi >tablec.out && diff $test_out/tablec.tty tablec.out || rc=22
-./dvi2tty -s $test_src/table.dvi >tables.out && diff $test_out/tables.tty tables.out || rc=23
-./dvi2tty -u $test_src/table.dvi >tableu.out && diff $test_out/tableu.tty tableu.out || rc=24
-./dvi2tty -u -C $test_src/table.dvi >tableuC.out && diff $test_out/tableuC.tty tableuC.out || rc=25
-./dvi2tty -Eu $test_src/table.dvi >tableEu.out && diff $test_out/tableEu.tty tableEu.out || rc=26
-./dvi2tty -Eu1 $test_src/table.dvi >tableEu1.out && diff $test_out/tableEu1.tty tableEu1.out || rc=27
-./dvi2tty -Eu -C $test_src/table.dvi >tableEuC.out && diff $test_out/tableEuC.tty tableEuC.out || rc=28
-./dvi2tty -Eu -a $test_src/table.dvi >tableEua.out && diff $test_out/tableEua.tty tableEua.out || rc=29
+$_dvi2tty $test_src/table.dvi >table.out && diff $test_out/table.tty table.out || rc=21
+$_dvi2tty -c $test_src/table.dvi >tablec.out && diff $test_out/tablec.tty tablec.out || rc=22
+$_dvi2tty -s $test_src/table.dvi >tables.out && diff $test_out/tables.tty tables.out || rc=23
+$_dvi2tty -u $test_src/table.dvi >tableu.out && diff $test_out/tableu.tty tableu.out || rc=24
+$_dvi2tty -u -C $test_src/table.dvi >tableuC.out && diff $test_out/tableuC.tty tableuC.out || rc=25
+$_dvi2tty -Eu $test_src/table.dvi >tableEu.out && diff $test_out/tableEu.tty tableEu.out || rc=26
+$_dvi2tty -Eu1 $test_src/table.dvi >tableEu1.out && diff $test_out/tableEu1.tty tableEu1.out || rc=27
+$_dvi2tty -Eu -C $test_src/table.dvi >tableEuC.out && diff $test_out/tableEuC.tty tableEuC.out || rc=28
+$_dvi2tty -Eu -a $test_src/table.dvi >tableEua.out && diff $test_out/tableEua.tty tableEua.out || rc=29
## CJK by pTeX / upTeX
-./dvi2tty -A -Eu -w100 -o ptex1Eu.out $test_src/ptex1.dvi && diff $test_out/ptex1Eu.tty ptex1Eu.out || rc=34
-./dvi2tty -J -Eu -w100 -o ptex1EuJ.out $test_src/ptex1.dvi && diff $test_out/ptex1Eu.tty ptex1EuJ.out || rc=35
+$_dvi2tty -A -Eu -w100 -o ptex1Eu.out $test_src/ptex1.dvi && diff $test_out/ptex1Eu.tty ptex1Eu.out || rc=34
+$_dvi2tty -J -Eu -w100 -o ptex1EuJ.out $test_src/ptex1.dvi && diff $test_out/ptex1Eu.tty ptex1EuJ.out || rc=35
-./dvi2tty -U -Eu -w100 -o uptex1.out $test_src/uptex1.dvi && diff $test_out/uptex1.tty uptex1.out || rc=36
-./dvi2tty -J -Eu -w100 -o uptex1J.out $test_src/uptex1.dvi && diff $test_out/uptex1.tty uptex1J.out || rc=37
+$_dvi2tty -U -Eu -w100 -o uptex1.out $test_src/uptex1.dvi && diff $test_out/uptex1.tty uptex1.out || rc=36
+$_dvi2tty -J -Eu -w100 -o uptex1J.out $test_src/uptex1.dvi && diff $test_out/uptex1.tty uptex1J.out || rc=37
## different position of FNTDEF and NOP
-./dvi2tty $test_src/fntdef0.dvi >fntdef0.out && diff $test_out/fntdef0.tty fntdef0.out || rc=41
-./dvi2tty $test_src/fntdef1.dvi >fntdef1.out && diff $test_out/fntdef0.tty fntdef1.out || rc=42
-./dvi2tty $test_src/fntdef2.dvi >fntdef2.out && diff $test_out/fntdef0.tty fntdef2.out || rc=43
-./dvi2tty $test_src/fntdef3.dvi >fntdef3.out && diff $test_out/fntdef0.tty fntdef3.out || rc=44
+$_dvi2tty $test_src/fntdef0.dvi >fntdef0.out && diff $test_out/fntdef0.tty fntdef0.out || rc=41
+$_dvi2tty $test_src/fntdef1.dvi >fntdef1.out && diff $test_out/fntdef0.tty fntdef1.out || rc=42
+$_dvi2tty $test_src/fntdef2.dvi >fntdef2.out && diff $test_out/fntdef0.tty fntdef2.out || rc=43
+$_dvi2tty $test_src/fntdef3.dvi >fntdef3.out && diff $test_out/fntdef0.tty fntdef3.out || rc=44
exit $rc
-