aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert2019-05-05 17:35:05 -0700
committerPaul Eggert2019-05-05 17:40:55 -0700
commit926a394997eaae55b797a90cb2cd037bbe3c3db4 (patch)
treea075ef40927dc732c254f2d63a98af8ca3d99c82 /src/lisp.h
parent31c60dfbd8541c9f1b1bc8127dde85e5d5af51b5 (diff)
downloademacs-926a394997eaae55b797a90cb2cd037bbe3c3db4.tar.gz
emacs-926a394997eaae55b797a90cb2cd037bbe3c3db4.zip
Use simpler way to print function pointers
The module code can’t possibly work on weird platforms where function pointers are wider than data pointers, so there’s no need to bother with the stackoverflow-like approach that is intended only for portability to such platforms. Besides, the stackoverflow-like approach does not work well on weird platforms where CHAR_BIT is not a multiple of 4. * src/lisp.h (pMx): New macro. * src/print.c (data_from_funcptr) [HAVE_MODULES]: New function. (print_vectorlike) [HAVE_MODULES]: Use it. (print_object): Make sure buf is big enough for this.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h
index ca833476c03..61cc20e9d42 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -144,11 +144,13 @@ typedef intmax_t printmax_t;
144typedef uintmax_t uprintmax_t; 144typedef uintmax_t uprintmax_t;
145# define pMd PRIdMAX 145# define pMd PRIdMAX
146# define pMu PRIuMAX 146# define pMu PRIuMAX
147# define pMx PRIxMAX
147#else 148#else
148typedef EMACS_INT printmax_t; 149typedef EMACS_INT printmax_t;
149typedef EMACS_UINT uprintmax_t; 150typedef EMACS_UINT uprintmax_t;
150# define pMd pI"d" 151# define pMd pI"d"
151# define pMu pI"u" 152# define pMu pI"u"
153# define pMx pI"x"
152#endif 154#endif
153 155
154/* Use pD to format ptrdiff_t values, which suffice for indexes into 156/* Use pD to format ptrdiff_t values, which suffice for indexes into