From d6e817751e1a809a4e635bbe7ece7e059cbe5f63 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Fri, 9 Aug 2019 08:06:39 -0700 Subject: listing: add -L option for additional listing info Add an -L option for additional listing information. Currently supported is -Le, which emits each line after processing through the preprocessor, and -Lm, which displays each single-line macro defined or undefined. NASM doesn't preserve the names of unused arguments, nor does it have any technical reason to do so. Instead of adding complexity to save them, make unnamed parameters official by specifying an empty string in the argument list. This has the additional advantage that () is now simply considered a single empty argument, which means that NASM should now properly handle things like: %define myreg() eax mov edx,myreg() ... similar to how the C preprocessor allows an empty macro argument list which is distinct from a macro with no arguments whatsoever. Signed-off-by: H. Peter Anvin (Intel) --- include/strlist.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/strlist.h b/include/strlist.h index 610aad4d..2c80d0be 100644 --- a/include/strlist.h +++ b/include/strlist.h @@ -46,6 +46,7 @@ struct strlist_entry { struct strlist_entry *next; size_t offset; size_t size; + intorptr pvt; char str[1]; }; @@ -61,6 +62,12 @@ strlist_head(const struct strlist *list) { return list ? list->head : NULL; } +static inline struct strlist_entry *strlist_tail(struct strlist *list) +{ + if (!list || !list->head) + return NULL; + return container_of(list->tailp, struct strlist_entry, next); +} static inline size_t strlist_count(const struct strlist *list) { return list ? list->nstr : 0; -- cgit v1.2.3