summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-05-02 12:33:41 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-05-02 12:33:41 +0000
commit2d11fdfd2797f0674e1ffc420b1cfa5bcc1732ce (patch)
tree4cca8cdaa2175fb293fb376a459d782ac07606b6 /Build
parent4911dacf8a9fd770f403274ecc081ebdd19381bd (diff)
mplibdir: Skip compilation of unused code
git-svn-id: svn://tug.org/texlive/trunk@22280 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/mplibdir/ChangeLog7
-rw-r--r--Build/source/texk/web2c/mplibdir/mp.w7
2 files changed, 11 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/mplibdir/ChangeLog b/Build/source/texk/web2c/mplibdir/ChangeLog
index ae4323e9685..18c5b2b8657 100644
--- a/Build/source/texk/web2c/mplibdir/ChangeLog
+++ b/Build/source/texk/web2c/mplibdir/ChangeLog
@@ -1,3 +1,10 @@
+2011-04-29 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * mp.w (mp_do_snprintf): Removed, instead declare and define
+ static internal version of mp_snprintf().
+ Compare change from 2009-12-05:
+ FIXME: Should unconditionally assume snprintf() exists.
+
2011-04-06 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/libmplib.am: Only one rule for tfmin.w => tfmin.c.
diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w
index 71ed0033708..679b32839a5 100644
--- a/Build/source/texk/web2c/mplibdir/mp.w
+++ b/Build/source/texk/web2c/mplibdir/mp.w
@@ -2727,7 +2727,6 @@ extern void *mp_xrealloc (MP mp, void *p, size_t nmem, size_t size);
extern void *mp_xmalloc (MP mp, size_t nmem, size_t size);
extern char *mp_xstrdup (MP mp, const char *s);
extern char *mp_xstrldup (MP mp, const char *s, size_t l);
-extern void mp_do_snprintf (char *str, int size, const char *fmt, ...);
@ Some care has to be taken while copying strings
@@ -2813,12 +2812,13 @@ char *mp_xstrdup (MP mp, const char *s) {
#ifdef HAVE_SNPRINTF
# define mp_snprintf (void)snprintf
#else
-# define mp_snprintf mp_do_snprintf
+static void mp_snprintf (char *str, int size, const char *fmt, ...);
#endif
@ This internal version is rather stupid, but good enough for its purpose.
@c
+#ifndef HAVE_SNPRINTF
static char *mp_itoa (int i) {
char res[32];
unsigned idx = 30;
@@ -2847,7 +2847,7 @@ static char *mp_utoa (unsigned v) {
res[idx--] = (char) (v + '0');
return mp_strdup ((res + idx + 1));
}
-void mp_do_snprintf (char *str, int size, const char *format, ...) {
+static void mp_snprintf (char *str, int size, const char *format, ...) {
const char *fmt;
char *res;
int fw, pad;
@@ -2964,6 +2964,7 @@ void mp_do_snprintf (char *str, int size, const char *format, ...) {
*res = '\0';
va_end (ap);
}
+#endif
@* Dynamic memory allocation.