aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert2011-07-07 14:52:44 -0700
committerPaul Eggert2011-07-07 14:52:44 -0700
commita81d11a3efb4d511c5c34c8983dc6aab5d619ea1 (patch)
treeb520dcbf5ee7ee4d6d601cbbb3e874265818980c /src/lisp.h
parent3300e6fd43c4059de955cddc37ec4212dab2b085 (diff)
downloademacs-a81d11a3efb4d511c5c34c8983dc6aab5d619ea1.tar.gz
emacs-a81d11a3efb4d511c5c34c8983dc6aab5d619ea1.zip
* editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
Remove, replacing with the new symbols in lisp.h. All uses changed. * fileio.c (make_temp_name): * filelock.c (lock_file_1, lock_file): * xdisp.c (message_dolog): Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts. Use pMd etc. instead. * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros, replacing the pWIDE etc. symbols removed from editfns.c.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h
index f16a32e6331..257c204e3b0 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -61,6 +61,23 @@ extern void check_cons_list (void);
61# define EMACS_UINT unsigned EMACS_INT 61# define EMACS_UINT unsigned EMACS_INT
62#endif 62#endif
63 63
64/* printmax_t and uprintmax_t are types for printing large integers.
65 These are the widest integers that are supported for printing.
66 pMd etc. are conversions for printing them.
67 On C99 hosts, there's no problem, as even the widest integers work.
68 Fall back on EMACS_INT on pre-C99 hosts. */
69#ifdef PRIdMAX
70typedef intmax_t printmax_t;
71typedef uintmax_t uprintmax_t;
72# define pMd PRIdMAX
73# define pMu PRIuMAX
74#else
75typedef EMACS_INT printmax_t;
76typedef EMACS_UINT uprintmax_t;
77# define pMd pI"d"
78# define pMu pI"u"
79#endif
80
64/* Use pD to format ptrdiff_t values, which suffice for indexes into 81/* Use pD to format ptrdiff_t values, which suffice for indexes into
65 buffers and strings. Emacs never allocates objects larger than 82 buffers and strings. Emacs never allocates objects larger than
66 PTRDIFF_MAX bytes, as they cause problems with pointer subtraction. 83 PTRDIFF_MAX bytes, as they cause problems with pointer subtraction.