diff options
| author | Paul Eggert | 2019-08-15 10:51:03 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-08-15 10:53:25 -0700 |
| commit | 96ef76e4e7df73802bf1f2a19c96a143ae365b66 (patch) | |
| tree | 26eb99caeb79bbbeb157023db946a152d1eeb1f7 /src | |
| parent | af82a6248ce77f1b14f89cfee677250ff024c2c4 (diff) | |
| download | emacs-96ef76e4e7df73802bf1f2a19c96a143ae365b66.tar.gz emacs-96ef76e4e7df73802bf1f2a19c96a143ae365b66.zip | |
Fix typeof portability issue with bitfields
Problem reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00300.html
* src/lisp.h (lisp_h_make_fixnum): Use typeof (+(n)) instead
of typeof (n), so that it works with compilers that do
not allow typeof to be applied to a bitfield.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lisp.h b/src/lisp.h index 1c98925fa8d..56ad99b8e39 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -401,7 +401,7 @@ typedef EMACS_INT Lisp_Word; | |||
| 401 | XIL ((EMACS_INT) (((EMACS_UINT) (n) << INTTYPEBITS) + Lisp_Int0)) | 401 | XIL ((EMACS_INT) (((EMACS_UINT) (n) << INTTYPEBITS) + Lisp_Int0)) |
| 402 | # if defined HAVE_STATEMENT_EXPRESSIONS && defined HAVE_TYPEOF | 402 | # if defined HAVE_STATEMENT_EXPRESSIONS && defined HAVE_TYPEOF |
| 403 | # define lisp_h_make_fixnum(n) \ | 403 | # define lisp_h_make_fixnum(n) \ |
| 404 | ({ typeof (n) lisp_h_make_fixnum_n = n; \ | 404 | ({ typeof (+(n)) lisp_h_make_fixnum_n = n; \ |
| 405 | eassert (!FIXNUM_OVERFLOW_P (lisp_h_make_fixnum_n)); \ | 405 | eassert (!FIXNUM_OVERFLOW_P (lisp_h_make_fixnum_n)); \ |
| 406 | lisp_h_make_fixnum_wrap (lisp_h_make_fixnum_n); }) | 406 | lisp_h_make_fixnum_wrap (lisp_h_make_fixnum_n); }) |
| 407 | # else | 407 | # else |