summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/print.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/print.c b/src/print.c
index 12da3b3b6d1..3609684c640 100644
--- a/src/print.c
+++ b/src/print.c
@@ -755,7 +755,12 @@ print (obj, printcharfun, escapeflag)
switch (XGCTYPE (obj))
{
case Lisp_Int:
- sprintf (buf, "%d", XINT (obj));
+ if (sizeof (int) == sizeof (EMACS_INT))
+ sprintf (buf, "%d", XINT (obj));
+ else if (sizeof (long) == sizeof (EMACS_INT))
+ sprintf (buf, "%ld", XINT (obj));
+ else
+ abort ();
strout (buf, -1, printcharfun);
break;