summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/mplibdir
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2019-03-06 13:23:58 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2019-03-06 13:23:58 +0000
commitc4f771a2be42ef7a46974bea88d0a71987280e77 (patch)
treef67fd4f9e693c9779d61a34dabbca0788cfa9c2b /Build/source/texk/web2c/mplibdir
parent5c369e9c0320131c484974d5aa932fe7d80cb7f4 (diff)
Sync with luatex revision 7102.
git-svn-id: svn://tug.org/texlive/trunk@50260 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/mplibdir')
-rw-r--r--Build/source/texk/web2c/mplibdir/mp.w23
-rw-r--r--Build/source/texk/web2c/mplibdir/psout.w3
2 files changed, 23 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w
index f4acc3d0e06..e0999e187f5 100644
--- a/Build/source/texk/web2c/mplibdir/mp.w
+++ b/Build/source/texk/web2c/mplibdir/mp.w
@@ -122,9 +122,24 @@ typedef struct pngout_data_struct *pngout_data;
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
+
#ifndef INTEGER_TYPE
typedef int integer;
+#define MPOST_ABS abs
+#else
+/* See source/texk/web2c/w2c/config.h */
+#if INTEGER_TYPE == long
+#ifdef HAVE_LABS
+#define MPOST_ABS labs
+#else
+#define MPOST_ABS abs
#endif
+#else
+#define MPOST_ABS abs
+#endif /* if INTEGER_TYPE == long */
+#endif /* ifndef INTEGER_TYPE */
+
+
@<Declare helpers@>;
@<Enumeration types@>;
@<Types in the outer block@>;
@@ -1783,7 +1798,7 @@ following subroutine is usually called with a parameter in the range |0<=n<=99|.
@c
static void mp_print_dd (MP mp, integer n) { /* prints two least significant digits */
- n = abs (n) % 100;
+ n = MPOST_ABS (n) % 100;
mp_print_char (mp, xord ('0' + (n / 10)));
mp_print_char (mp, xord ('0' + (n % 10)));
}
@@ -2943,7 +2958,11 @@ void *mp_xmalloc (MP mp, size_t nmem, size_t size) {
}
@ @<Internal library declarations@>=
-# define mp_snprintf (void)snprintf
+int mp_snprintf_res ;
+/* Some compilers (i.e. gcc 8.2.0 ) complained with the old */
+/* #define mp_snprintf (void)snprintf */
+/* about truncation. For the moment we store the result. */
+# define mp_snprintf mp_snprintf_res=snprintf
@* Dynamic memory allocation.
diff --git a/Build/source/texk/web2c/mplibdir/psout.w b/Build/source/texk/web2c/mplibdir/psout.w
index 6616d80b100..3c46d31879c 100644
--- a/Build/source/texk/web2c/mplibdir/psout.w
+++ b/Build/source/texk/web2c/mplibdir/psout.w
@@ -267,7 +267,7 @@ following subroutine is usually called with a parameter in the range |0<=n<=99|.
@c
static void mp_ps_print_dd (MP mp,integer n) { /* prints two least significant digits */
- n=abs(n) % 100;
+ n= MPOST_ABS(n) % 100;
mp_ps_print_char(mp, '0'+(n / 10));
mp_ps_print_char(mp, '0'+(n % 10));
}
@@ -560,6 +560,7 @@ avl_tree enc_tree;
@<Static variables in the outer block@>=
static char notdef[] = ".notdef";
+
@ @<Set initial...@>=
mp->ps->enc_tree = NULL;