preproc: fix parsing of single-line macro arguments, cleanups
commit1c21a53e4ed03371df5d9f16359545862bb4820e
authorH. Peter Anvin (Intel) <hpa@zytor.com>
Fri, 9 Aug 2019 09:34:21 +0000 (9 02:34 -0700)
committerH. Peter Anvin (Intel) <hpa@zytor.com>
Fri, 9 Aug 2019 09:34:21 +0000 (9 02:34 -0700)
tree7c44b46c5a35a8bcffd1d7698aaaddce6af4d148
parent80ba65e830589b2b4e77112445ab03a3ce1de773
preproc: fix parsing of single-line macro arguments, cleanups

The single-line macro argument parsing was completely broken as a
comma would not be recognized as an argument separator.

In the process of fixing this, make a fair bit of code cleanups.

Note: reverse tokens for smacro->expansion doesn't actually make any
sense anymore, might reconsider that.

This checkin also removes the distinction between "magic" and plain
smacros; the only difference is which specific expand method is being
invoked.

Finally, extend the allocating-string functions such that *all* the
allocating string functions support querying the length of the string
a posteori.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
asm/preproc.c
include/nasmlib.h
nasmlib/alloc.c
nasmlib/alloc.h
nasmlib/asprintf.c
nasmlib/strlist.c