Apply updated version of fix submitted with feature request 803785.
This fix causes %exitrep to terminate only the innermost %rep block,
and also allows the count for nested blocks to be calculated in the
containing block.
I noticed there was no sane way to concatenate the contents of quoted
strings, so add the %strcat directive.
These really need to become preprocessor functions at some stage.
Fix nasm_str[n]icmp() on platforms which don't have this function
natively.
XXX: Given the new nasm_tolower() implementation, we should consider
if this might actually be a faster function than the platform-native
one.
Instead of an array of strings, just have a character array; that
reduces the size of canned macros by up to 30%, and we only did
sequential access anyway.
ctype functions take an *int*, which the user is expected to have
taken the input character from getc() and friends, or taken a
character and cast it to (unsigned char).
We don't care about EOF (-1), so use macros that cast to (unsigned
char) for us.
Move the handling of "extra" macros (i.e. output format macros) into
the macros.pl mechanism. This allows us to change the format of the
internal macro store in the future - e.g. to a single byte store
without redundant pointers.
Also, stop using indicies into a long array when there is no good
reason to not just use different arrays.
Automatically generate a %define as the first string in the include
block, and just pick the string out of it from that %define statement
to verify existence. That way we eliminate any use of toupper() --
all case-insensitivity in NASM uses tolower()/nasm_tolower().
Automatically provide an include guard for %use packages; the macro
__USE_package__ is automatically defined, and inclusion is suppressed
if it is already defined.
Add a framework for documenting the standard macro packages. Also
move the standard macros to the end of the preprocessor section,
instead of having them in the middle of the directives list.
Compress macros.c by representing macro directives with a single byte.
We can do this because we only use the ASCII character range inside
the standard macro files.
Note: we could save significant additional space by not having a
pointer array, and instead relying on the fact that we sweep
sequentially through the output array.
Add a builtin equivalent to the %include directive called %use.
%use includes a standard macro file compiled into the binary; these
come from the macros/ directory in the source code.
The idea here is to be able to provide optional macro packages with
the distribution, without adding complex host filesystem dependencies.
For PostScript to PDF conversion, use whichever of "acrodist",
"ps2pdf", or "pstopdf" which we can find on the system. I haven't
tried either acrodist or pstopdf myself, only going my the
documentation, but prefer acrodist since it is claimed to produce
smaller output files than ps2pdf.
This is a maintenance tool only, it doesn't change the code in any
way. However, it makes it a lot less likely that we'll have a release
go out with a broken Makefile.
In the case where the directory name should be removed (null pathname
separator) don't search backwards past an equal sign, just in case
there isn't a space after the assignment.