summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-11-06 13:40:17 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-11-06 13:40:17 +0000
commitc08eff2883a952dd0f9325c51ad7968370452b02 (patch)
tree72080b810e039359df54696191cebf66f21d677b /Build/source
parente8386671e9408e3e71d63a518a5d8851689c3e7c (diff)
MinGW64 build: Fix minor glitches, avoid compiler warnings
git-svn-id: svn://tug.org/texlive/trunk@35527 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/chktex/ChangeLog4
-rw-r--r--Build/source/texk/chktex/regex/regcomp.c8
-rw-r--r--Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/ChangeLog4
-rw-r--r--Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/patch-02-mingw6414
-rw-r--r--Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/config.h1
-rw-r--r--Build/source/texk/ps2pkm/ChangeLog4
-rw-r--r--Build/source/texk/ps2pkm/regions.c4
-rw-r--r--Build/source/texk/web2c/ChangeLog5
-rw-r--r--Build/source/texk/web2c/c-auto.in10
-rwxr-xr-xBuild/source/texk/web2c/configure70
-rw-r--r--Build/source/texk/web2c/configure.ac2
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog4
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c17
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c17
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/pdftexdir/regex/regcomp.c8
-rw-r--r--Build/source/texk/web2c/texmfmp.h21
-rw-r--r--Build/source/texk/web2c/w2c/config.h9
-rw-r--r--Build/source/texk/web2c/web2c/ChangeLog5
-rw-r--r--Build/source/texk/web2c/web2c/c-auto.in13
-rwxr-xr-xBuild/source/texk/web2c/web2c/configure131
-rw-r--r--Build/source/texk/web2c/web2c/configure.ac7
23 files changed, 324 insertions, 42 deletions
diff --git a/Build/source/texk/chktex/ChangeLog b/Build/source/texk/chktex/ChangeLog
index 5b91dcb88c1..feb2a3e370a 100644
--- a/Build/source/texk/chktex/ChangeLog
+++ b/Build/source/texk/chktex/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * regex/regcomp.c [WIN64]: Use __int64 (not long) as intptr_t.
+
2014-06-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am: Drop the obsolete ACLOCAL_AMFLAGS.
diff --git a/Build/source/texk/chktex/regex/regcomp.c b/Build/source/texk/chktex/regex/regcomp.c
index 7b50c10b0a6..9a6cd159baf 100644
--- a/Build/source/texk/chktex/regex/regcomp.c
+++ b/Build/source/texk/chktex/regex/regcomp.c
@@ -2499,7 +2499,11 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
old_tree = NULL;
if (elem->token.type == SUBEXP)
+#ifdef _WIN64
+ postorder (elem, mark_opt_subexp, (void *) (__int64) elem->token.opr.idx);
+#else
postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
+#endif
tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
if (BE (tree == NULL, 0))
@@ -3711,7 +3715,11 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
static reg_errcode_t
mark_opt_subexp (void *extra, bin_tree_t *node)
{
+#ifdef _WIN64
+ int idx = (int) (__int64) extra;
+#else
int idx = (int) (long) extra;
+#endif
if (node->token.type == SUBEXP && node->token.opr.idx == idx)
node->token.opt_subexp = 1;
diff --git a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/ChangeLog b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/ChangeLog
index 00cdb181c7b..1aaa9375bf6 100644
--- a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/ChangeLog
+++ b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-02-mingw64 (new): Avoid MinGW64 warnings.
+
2014-11-05 Peter Breitenlohner <peb@mppmu.mpg.de>
* patch-01-win64 (new): Required for MinGW64.
diff --git a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/patch-02-mingw64 b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/patch-02-mingw64
new file mode 100644
index 00000000000..0c4eb654b3c
--- /dev/null
+++ b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104-PATCHES/patch-02-mingw64
@@ -0,0 +1,14 @@
+ MinGW64 complains when <winsock2.h> is included after <windows.h>
+ (via include/efont/otfdata.hh).
+
+diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.104.orig/include/config.h lcdf-typetools-2.104/include/config.h
+--- lcdf-typetools-2.104.orig/include/config.h 2013-09-17 15:27:20.000000000 +0200
++++ lcdf-typetools-2.104/include/config.h 2014-11-06 11:47:10.000000000 +0100
+@@ -6,6 +6,7 @@
+ /* Allow compilation on Windows (thanks, Fabrice Popineau). */
+ #ifdef WIN32
+ # ifdef __MINGW32__
++# include <winsock2.h>
+ # include <windows.h>
+ # else
+ # include <win32lib.h>
diff --git a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/config.h b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/config.h
index 26a90a97b14..18cab5cff07 100644
--- a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/config.h
+++ b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/config.h
@@ -6,6 +6,7 @@
/* Allow compilation on Windows (thanks, Fabrice Popineau). */
#ifdef WIN32
# ifdef __MINGW32__
+# include <winsock2.h>
# include <windows.h>
# else
# include <win32lib.h>
diff --git a/Build/source/texk/ps2pkm/ChangeLog b/Build/source/texk/ps2pkm/ChangeLog
index f7fadb079da..421f327b5d2 100644
--- a/Build/source/texk/ps2pkm/ChangeLog
+++ b/Build/source/texk/ps2pkm/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * regions.c [WIN64]: Use __int64 (not long) as intptr_t.
+
2014-10-14 Peter Breitenlohner <peb@mppmu.mpg.de>
* paths.c: Fixed a bug introduced by the previous "Bug fix".
diff --git a/Build/source/texk/ps2pkm/regions.c b/Build/source/texk/ps2pkm/regions.c
index 8a513c19d51..f1b4b8b4700 100644
--- a/Build/source/texk/ps2pkm/regions.c
+++ b/Build/source/texk/ps2pkm/regions.c
@@ -305,7 +305,11 @@ if the xvalues are long aligned by ANDing the address with the
(sizeof(long) - 1)--if non zero, the xvalues are not aligned well. We
set 'iy' to the ymin value that would give us good alignment:
*/
+#ifdef _WIN64
+ iy = ymin - (((unsigned __int64) xvalues) & (sizeof(int32_t) - 1)) / sizeof(pel);
+#else
iy = ymin - (((unsigned long) xvalues) & (sizeof(int32_t) - 1)) / sizeof(pel);
+#endif
r = (struct edgelist *)Allocate(sizeof(struct edgelist), &template,
(ymax - iy) * sizeof(pel));
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 84c49a5778b..ed9091b5af0 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -3,6 +3,11 @@
* mf.ch, tftopl.ch, vftovp.ch: Add stringcast to avoid printing
strings as numbers.
+ * configure.ac: AC_CHECK_SIZEOF([void *]) and AC_TYPE_UINTPTR_T.
+ * w2c/config.h: If necessary define uintptr_t.
+ * texmfmp.h: Cast pointers to uintptr_t and use PRIdPTR, PRIxPTR
+ to print them.
+
2014-10-30 Peter Breitenlohner <peb@mppmu.mpg.de>
* texmfmp.h: Define here whether or not to build tex*.dll.
diff --git a/Build/source/texk/web2c/c-auto.in b/Build/source/texk/web2c/c-auto.in
index 53d0046bc05..33beb7bf8b1 100644
--- a/Build/source/texk/web2c/c-auto.in
+++ b/Build/source/texk/web2c/c-auto.in
@@ -221,6 +221,9 @@
/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H
+/* Define to 1 if the system has the type `uintptr_t'. */
+#undef HAVE_UINTPTR_T
+
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@@ -282,6 +285,9 @@
/* The size of `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -366,6 +372,10 @@
such a type exists and the standard includes do not define it. */
#undef uint64_t
+/* Define to the type of an unsigned integer type wide enough to hold a
+ pointer, if such a type exists, and if the system does not define it. */
+#undef uintptr_t
+
/* Define as empty if not declared in <zlib.h>. */
#undef z_const
diff --git a/Build/source/texk/web2c/configure b/Build/source/texk/web2c/configure
index 93641eeacc6..5e0ac3921ab 100755
--- a/Build/source/texk/web2c/configure
+++ b/Build/source/texk/web2c/configure
@@ -21092,6 +21092,76 @@ fi
done
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if ${ac_cv_sizeof_void_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_void_p" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+
+ ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+
+else
+ for ac_type in 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5
$as_echo_n "checking for long double... " >&6; }
diff --git a/Build/source/texk/web2c/configure.ac b/Build/source/texk/web2c/configure.ac
index 70db03fec7e..90e813aa169 100644
--- a/Build/source/texk/web2c/configure.ac
+++ b/Build/source/texk/web2c/configure.ac
@@ -252,6 +252,8 @@ AC_SEARCH_LIBS([pow], [m])
AC_CHECK_FUNCS([access atoi fmax ftime gettimeofday mkdtemp setlocale strerror strlcat strlcpy strndup])
AC_CHECK_DECLS([strndup])
AC_CHECK_HEADERS([errno.h langinfo.h locale.h sys/time.h sys/timeb.h sys/wait.h time.h])
+AC_CHECK_SIZEOF([void *])
+AC_TYPE_UINTPTR_T
AC_TYPE_LONG_DOUBLE
AC_HEADER_STDBOOL
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 566d6d43aac..99eb4bb6b6b 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * texmfmp.c: Avoid MinGW64 warnings (INVALID_SOCKET => -1).
+
2014-11-03 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
* texmfmp.c: Indentation.
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 7d224726e59..00e32e63283 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -1127,10 +1127,7 @@ ipc_make_name (void)
return ipc_addr_len;
}
-#ifndef INVALID_SOCKET
-# define INVALID_SOCKET (-1)
-#endif
-static int sock = INVALID_SOCKET;
+static int sock = -1;
#ifdef WIN32
# define CLOSE_SOCKET(s) closesocket (s); WSACleanup ()
@@ -1141,7 +1138,7 @@ static int sock = INVALID_SOCKET;
static int
ipc_is_open (void)
{
- return sock != INVALID_SOCKET;
+ return sock != -1;
}
static void
@@ -1154,7 +1151,7 @@ ipc_open_out (void) {
#ifdef IPC_DEBUG
fputs ("tex: Opening socket for IPC output ...\n", stderr);
#endif
- if (sock != INVALID_SOCKET) {
+ if (sock != -1) {
return;
}
@@ -1170,13 +1167,13 @@ ipc_open_out (void) {
sock = socket (IPC_AF, SOCK_STREAM, 0);
#ifdef IPC_DEBUG
- if(sock != INVALID_SOCKET)
+ if(sock != -1)
fprintf(stderr, "tex: Socket handle is %d\n", sock);
else
fprintf(stderr, "tex: Socket is invalid.\n");
#endif
- if (sock != INVALID_SOCKET) {
+ if (sock != -1) {
if (connect (sock, ipc_addr, ipc_addr_len) != 0 ||
#ifdef WIN32
ioctlsocket (sock, FIONBIO, &mode) < 0
@@ -1185,7 +1182,7 @@ ipc_open_out (void) {
#endif
) {
CLOSE_SOCKET (sock);
- sock = INVALID_SOCKET;
+ sock = -1;
#ifdef IPC_DEBUG
fputs ("tex: IPC socket cannot be connected.\n", stderr);
fputs ("tex: Socket is closed.\n", stderr);
@@ -1206,7 +1203,7 @@ ipc_close_out (void)
#endif
if (ipc_is_open ()) {
CLOSE_SOCKET (sock);
- sock = INVALID_SOCKET;
+ sock = -1;
}
}
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 480045cdb84..2d306f53c48 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * luatex.c: Avoid MinGW64 warnings (INVALID_SOCKET => -1).
+
2014-11-03 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* luatex.c: Indentation.
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index db426fe0d92..c5b1ee034b1 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -648,10 +648,7 @@ ipc_make_name (void)
return ipc_addr_len;
}
-#ifndef INVALID_SOCKET
-# define INVALID_SOCKET (-1)
-#endif
-static int sock = INVALID_SOCKET;
+static int sock = -1;
#ifdef WIN32
# define CLOSE_SOCKET(s) closesocket (s); WSACleanup ()
@@ -662,7 +659,7 @@ static int sock = INVALID_SOCKET;
static int
ipc_is_open (void)
{
- return sock != INVALID_SOCKET;
+ return sock != -1;
}
static void
@@ -675,7 +672,7 @@ ipc_open_out (void) {
#ifdef IPC_DEBUG
fputs ("tex: Opening socket for IPC output ...\n", stderr);
#endif
- if (sock != INVALID_SOCKET) {
+ if (sock != -1) {
return;
}
@@ -691,13 +688,13 @@ ipc_open_out (void) {
sock = socket (IPC_AF, SOCK_STREAM, 0);
#ifdef IPC_DEBUG
- if(sock != INVALID_SOCKET)
+ if(sock != -1)
fprintf(stderr, "tex: Socket handle is %d\n", sock);
else
fprintf(stderr, "tex: Socket is invalid.\n");
#endif
- if (sock != INVALID_SOCKET) {
+ if (sock != -1) {
if (connect (sock, ipc_addr, ipc_addr_len) != 0 ||
#ifdef WIN32
ioctlsocket (sock, FIONBIO, &mode) < 0
@@ -706,7 +703,7 @@ ipc_open_out (void) {
#endif
) {
CLOSE_SOCKET (sock);
- sock = INVALID_SOCKET;
+ sock = -1;
#ifdef IPC_DEBUG
fputs ("tex: IPC socket cannot be connected.\n", stderr);
fputs ("tex: Socket is closed.\n", stderr);
@@ -727,7 +724,7 @@ ipc_close_out (void)
#endif
if (ipc_is_open ()) {
CLOSE_SOCKET (sock);
- sock = INVALID_SOCKET;
+ sock = -1;
}
}
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index 6f048becfbe..c7bebe0b6f5 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * regex/regcomp.c [WIN64]: Use __int64 (not long) as intptr_t.
+
2014-08-19 Peter Breitenlohner <peb@mppmu.mpg.de>
* writepng.c: Avoid PNG warnings.
diff --git a/Build/source/texk/web2c/pdftexdir/regex/regcomp.c b/Build/source/texk/web2c/pdftexdir/regex/regcomp.c
index 7b50c10b0a6..9a6cd159baf 100644
--- a/Build/source/texk/web2c/pdftexdir/regex/regcomp.c
+++ b/Build/source/texk/web2c/pdftexdir/regex/regcomp.c
@@ -2499,7 +2499,11 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
old_tree = NULL;
if (elem->token.type == SUBEXP)
+#ifdef _WIN64
+ postorder (elem, mark_opt_subexp, (void *) (__int64) elem->token.opr.idx);
+#else
postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
+#endif
tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
if (BE (tree == NULL, 0))
@@ -3711,7 +3715,11 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
static reg_errcode_t
mark_opt_subexp (void *extra, bin_tree_t *node)
{
+#ifdef _WIN64
+ int idx = (int) (__int64) extra;
+#else
int idx = (int) (long) extra;
+#endif
if (node->token.type == SUBEXP && node->token.opr.idx == idx)
node->token.opt_subexp = 1;
diff --git a/Build/source/texk/web2c/texmfmp.h b/Build/source/texk/web2c/texmfmp.h
index f0a244549f0..a4cd5f28cc8 100644
--- a/Build/source/texk/web2c/texmfmp.h
+++ b/Build/source/texk/web2c/texmfmp.h
@@ -290,6 +290,13 @@ extern void paintrow (/*screenrow, pixelcolor, transspec, screencol*/);
#define undumpthings(base, len) \
do_undump ((char *) &(base), sizeof (base), (int) (len), DUMP_FILE)
+#ifndef PRIdPTR
+#define PRIdPTR "ld"
+#endif
+#ifndef PRIxPTR
+#define PRIxPTR "lx"
+#endif
+
/* Like do_undump, but check each value against LOW and HIGH. The
slowdown isn't significant, and this improves the chances of
detecting incompatible format files. In fact, Knuth himself noted
@@ -301,9 +308,10 @@ extern void paintrow (/*screenrow, pixelcolor, transspec, screencol*/);
undumpthings (base, len); \
for (i = 0; i < (len); i++) { \
if ((&(base))[i] < (low) || (&(base))[i] > (high)) { \
- FATAL5 ("Item %u (=%ld) of .fmt array at %lx <%ld or >%ld", \
- i, (unsigned long) (&(base))[i], (unsigned long) &(base),\
- (unsigned long) low, (unsigned long) high); \
+ FATAL5 ("Item %u (=%" PRIdPTR ") of .fmt array at %" PRIxPTR \
+ " <%" PRIdPTR " or >%" PRIdPTR, \
+ i, (uintptr_t) (&(base))[i], (uintptr_t) &(base), \
+ (uintptr_t) low, (uintptr_t) high); \
} \
} \
} while (0)
@@ -317,9 +325,10 @@ extern void paintrow (/*screenrow, pixelcolor, transspec, screencol*/);
undumpthings (base, len); \
for (i = 0; i < (len); i++) { \
if ((&(base))[i] > (high)) { \
- FATAL4 ("Item %u (=%ld) of .fmt array at %lx >%ld", \
- i, (unsigned long) (&(base))[i], (unsigned long) &(base),\
- (unsigned long) high); \
+ FATAL4 ("Item %u (=%" PRIdPTR ") of .fmt array at %" PRIxPTR \
+ " >%" PRIdPTR, \
+ i, (uintptr_t) (&(base))[i], (uintptr_t) &(base), \
+ (uintptr_t) high); \
} \
} \
} while (0)
diff --git a/Build/source/texk/web2c/w2c/config.h b/Build/source/texk/web2c/w2c/config.h
index d3f15e8f09a..25ba9b7f559 100644
--- a/Build/source/texk/web2c/w2c/config.h
+++ b/Build/source/texk/web2c/w2c/config.h
@@ -99,6 +99,15 @@ typedef __int64 integer64;
#else
typedef int64_t integer64;
#endif
+
+/* And we need uintptr_t. */
+#ifndef HAVE_UINTPTR_T
+# if SIZEOF_VOID_P == SIZEOF_INT
+typedef unsigned int uintptr_t;
+# elif SIZEOF_VOID_P == SIZEOF_LONG
+typedef unsigned long uintptr_t;
+# endif
+#endif
/* I don't want to write a configure test for remove when all Unix
machines have unlink. But, for the sake of non-Unix machines that
diff --git a/Build/source/texk/web2c/web2c/ChangeLog b/Build/source/texk/web2c/web2c/ChangeLog
index 36b4304c111..15c7b6ac10e 100644
--- a/Build/source/texk/web2c/web2c/ChangeLog
+++ b/Build/source/texk/web2c/web2c/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * configure.ac: Add AC_CHECK_SIZEOF([long]),
+ AC_CHECK_SIZEOF([void *]) and AC_TYPE_UINTPTR_T.
+
2014-06-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am: Drop the obsolete ACLOCAL_AMFLAGS.
diff --git a/Build/source/texk/web2c/web2c/c-auto.in b/Build/source/texk/web2c/web2c/c-auto.in
index 602848dec80..014d6241bf7 100644
--- a/Build/source/texk/web2c/web2c/c-auto.in
+++ b/Build/source/texk/web2c/web2c/c-auto.in
@@ -108,6 +108,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
+/* Define to 1 if the system has the type `uintptr_t'. */
+#undef HAVE_UINTPTR_T
+
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@@ -138,6 +141,12 @@
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -186,3 +195,7 @@
/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#undef uint64_t
+
+/* Define to the type of an unsigned integer type wide enough to hold a
+ pointer, if such a type exists, and if the system does not define it. */
+#undef uintptr_t
diff --git a/Build/source/texk/web2c/web2c/configure b/Build/source/texk/web2c/web2c/configure
index 59946bc516e..c53befab554 100755
--- a/Build/source/texk/web2c/web2c/configure
+++ b/Build/source/texk/web2c/web2c/configure
@@ -13477,6 +13477,29 @@ case $LEX in
esac
+for ac_func in strerror
+do :
+ ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
+if test "x$ac_cv_func_strerror" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRERROR 1
+_ACEOF
+
+fi
+done
+
+for ac_header in errno.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_errno_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ERRNO_H 1
+_ACEOF
+
+fi
+
+done
+
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -13510,28 +13533,108 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-for ac_func in strerror
-do :
- ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
-if test "x$ac_cv_func_strerror" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STRERROR 1
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if ${ac_cv_sizeof_void_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_void_p" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
fi
-done
-for ac_header in errno.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
-if test "x$ac_cv_header_errno_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_ERRNO_H 1
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
_ACEOF
+
+
+ ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+
+else
+ for ac_type in 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
fi
-done
ac_config_headers="$ac_config_headers kpathsea/c-auto.h:c-auto.in"
diff --git a/Build/source/texk/web2c/web2c/configure.ac b/Build/source/texk/web2c/web2c/configure.ac
index c70d78ec4e2..56dc0e6d515 100644
--- a/Build/source/texk/web2c/web2c/configure.ac
+++ b/Build/source/texk/web2c/web2c/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with Autoconf to produce a configure script for Web2c.
dnl
-dnl Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
+dnl Copyright (C) 2009-2014 Peter Breitenlohner <tex-live@tug.org>
dnl
dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
@@ -28,9 +28,12 @@ KPSE_COMMON([web2c convert])
AC_PROG_YACC
KPSE_PROG_LEX
-AC_CHECK_SIZEOF([int])
AC_CHECK_FUNCS([strerror])
AC_CHECK_HEADERS([errno.h])
+AC_CHECK_SIZEOF([int])
+AC_CHECK_SIZEOF([long])
+AC_CHECK_SIZEOF([void *])
+AC_TYPE_UINTPTR_T
dnl Write output here, instead of putting a zillion -D's on the command line.
AC_CONFIG_HEADERS([kpathsea/c-auto.h:c-auto.in])