aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2017-02-05 14:07:11 -0800
committerPaul Eggert2017-02-05 14:07:31 -0800
commitd45dbccc5d2360818e70bbb0bc816c62c8cf6cbe (patch)
treed8c094478112300cc1fd3a810a8ad92f309dbd02 /src
parentc3ee4d2860a79503f0ea5a3ccdc8d4d1adaa8e57 (diff)
downloademacs-d45dbccc5d2360818e70bbb0bc816c62c8cf6cbe.tar.gz
emacs-d45dbccc5d2360818e70bbb0bc816c62c8cf6cbe.zip
Port to clang 3.8.0
It does not allow a for-loop's control var to be an anonymous struct. * src/lisp.h (struct for_each_tail_internal): New type. (FOR_EACH_TAIL_INTERNAL): Use it.
Diffstat (limited to 'src')
-rw-r--r--src/lisp.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lisp.h b/src/lisp.h
index edbd15170f8..b753971fb9c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4603,6 +4603,14 @@ enum
4603#define FOR_EACH_TAIL_SAFE(list) \ 4603#define FOR_EACH_TAIL_SAFE(list) \
4604 FOR_EACH_TAIL_INTERNAL (list, (void) 0, (void) (li.tail = Qnil), false) 4604 FOR_EACH_TAIL_INTERNAL (list, (void) 0, (void) (li.tail = Qnil), false)
4605 4605
4606/* Iterator intended for use only within FOR_EACH_TAIL_INTERNAL. */
4607struct for_each_tail_internal
4608{
4609 Lisp_Object tail, tortoise;
4610 intptr_t max, n;
4611 unsigned short int q;
4612};
4613
4606/* Like FOR_EACH_TAIL (LIST), except evaluate DOTTED or CYCLE, 4614/* Like FOR_EACH_TAIL (LIST), except evaluate DOTTED or CYCLE,
4607 respectively, if a dotted list or cycle is found, and check for 4615 respectively, if a dotted list or cycle is found, and check for
4608 quit if CHECK_QUIT. This is an internal macro intended for use 4616 quit if CHECK_QUIT. This is an internal macro intended for use
@@ -4619,9 +4627,7 @@ enum
4619 is little point to calling maybe_quit here. */ 4627 is little point to calling maybe_quit here. */
4620 4628
4621#define FOR_EACH_TAIL_INTERNAL(list, dotted, cycle, check_quit) \ 4629#define FOR_EACH_TAIL_INTERNAL(list, dotted, cycle, check_quit) \
4622 for (struct { Lisp_Object tail, tortoise; intptr_t max, n; \ 4630 for (struct for_each_tail_internal li = { list, list, 2, 0, 2 }; \
4623 unsigned short int q; \
4624 } li = { list, list, 2, 0, 2 }; \
4625 CONSP (li.tail) || (dotted, false); \ 4631 CONSP (li.tail) || (dotted, false); \
4626 (li.tail = XCDR (li.tail), \ 4632 (li.tail = XCDR (li.tail), \
4627 ((--li.q != 0 \ 4633 ((--li.q != 0 \