diff options
author | Luigi Scarso <luigi.scarso@gmail.com> | 2019-03-06 13:23:58 +0000 |
---|---|---|
committer | Luigi Scarso <luigi.scarso@gmail.com> | 2019-03-06 13:23:58 +0000 |
commit | c4f771a2be42ef7a46974bea88d0a71987280e77 (patch) | |
tree | f67fd4f9e693c9779d61a34dabbca0788cfa9c2b /Build/source/texk/web2c/mplibdir/mp.w | |
parent | 5c369e9c0320131c484974d5aa932fe7d80cb7f4 (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/mp.w')
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mp.w | 23 |
1 files changed, 21 insertions, 2 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. |