diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2019-08-09 08:06:39 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2019-08-09 08:39:02 -0700 |
commit | d6e817751e1a809a4e635bbe7ece7e059cbe5f63 (patch) | |
tree | 41b276a7c44d9350ec1fa4d2eb2daada09970541 /include | |
parent | d66927a677f75d3c3f5e835054f19f80b4b27179 (diff) | |
download | nasm-d6e817751e1a809a4e635bbe7ece7e059cbe5f63.tar.gz |
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) <hpa@zytor.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/strlist.h | 7 |
1 files changed, 7 insertions, 0 deletions
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; |