diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 12 |
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. */ | ||
| 4607 | struct 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 \ |