preproc.c: Turn off rmacro,exitmacro support
We've a problem in supporting [i]rmacro, exitmacro facilities at moment. In a sake of not holding new NASM release any longer these directives are just marked as being "forbidden". This allow us to not squash much changes in current source code base but remain on a safe side same time. Reviewed-by: Keith Kanios <keith@kanios.net> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
3031bb8ee2
commit
f09116f445
3 changed files with 43 additions and 33 deletions
|
@ -12,11 +12,11 @@ since 2007.
|
|||
|
||||
\b A number of enhancements/fixes in macros area.
|
||||
|
||||
\b Support for arbitrarily terminating macro expansions \c{%exitmacro}.
|
||||
See \k{exitmacro}.
|
||||
\#\b Support for arbitrarily terminating macro expansions \c{%exitmacro}.
|
||||
\# See \k{exitmacro}.
|
||||
|
||||
\b Support for recursive macro expansion \c{%rmacro}/\c{%irmacro}.
|
||||
See \k{mlrmacro}.
|
||||
\#\b Support for recursive macro expansion \c{%rmacro}/\c{%irmacro}.
|
||||
\# See \k{mlrmacro}.
|
||||
|
||||
\b Support for converting strings to tokens. See \k{deftok}.
|
||||
|
||||
|
|
|
@ -2403,21 +2403,20 @@ things like
|
|||
\c silly {13,10}, crlf ; crlf: db 13,10
|
||||
|
||||
|
||||
\S{mlrmacro} \i{Recursive Multi-Line Macros}: \I\c{%irmacro}\i\c{%rmacro}
|
||||
|
||||
A multi-line macro cannot be referenced within itself, in order to
|
||||
prevent accidental infinite recursion.
|
||||
|
||||
Recursive multi-line macros allow for self-referencing, with the
|
||||
caveat that the user is aware of the existence, use and purpose of
|
||||
recursive multi-line macros. There is also a generous, but sane, upper
|
||||
limit to the number of recursions, in order to prevent run-away memory
|
||||
consumption in case of accidental infinite recursion.
|
||||
|
||||
As with non-recursive multi-line macros, recursive multi-line macros are
|
||||
\i{case-sensitive}, unless you define them using the alternative
|
||||
directive \c{%irmacro}.
|
||||
|
||||
\#\S{mlrmacro} \i{Recursive Multi-Line Macros}: \I\c{%irmacro}\i\c{%rmacro}
|
||||
\#
|
||||
\#A multi-line macro cannot be referenced within itself, in order to
|
||||
\#prevent accidental infinite recursion.
|
||||
\#
|
||||
\#Recursive multi-line macros allow for self-referencing, with the
|
||||
\#caveat that the user is aware of the existence, use and purpose of
|
||||
\#recursive multi-line macros. There is also a generous, but sane, upper
|
||||
\#limit to the number of recursions, in order to prevent run-away memory
|
||||
\#consumption in case of accidental infinite recursion.
|
||||
\#
|
||||
\#As with non-recursive multi-line macros, recursive multi-line macros are
|
||||
\#\i{case-sensitive}, unless you define them using the alternative
|
||||
\#directive \c{%irmacro}.
|
||||
|
||||
\S{mlmacover} Overloading Multi-Line Macros\I{overloading, multi-line macros}
|
||||
|
||||
|
@ -2827,20 +2826,20 @@ does \e{not} remove the macro \c{bar}, since the argument
|
|||
specification does not match exactly.
|
||||
|
||||
|
||||
\S{exitmacro} Exiting Multi-Line Macros: \i\c{%exitmacro}
|
||||
|
||||
Multi-line macro expansions can be arbitrarily terminated with
|
||||
the \c{%exitmacro} directive.
|
||||
|
||||
For example:
|
||||
|
||||
\c %macro foo 1-3
|
||||
\c ; Do something
|
||||
\c %if<condition>
|
||||
\c %exitmacro
|
||||
\c %endif
|
||||
\c ; Do something
|
||||
\c %endmacro
|
||||
\#\S{exitmacro} Exiting Multi-Line Macros: \i\c{%exitmacro}
|
||||
\#
|
||||
\#Multi-line macro expansions can be arbitrarily terminated with
|
||||
\#the \c{%exitmacro} directive.
|
||||
\#
|
||||
\#For example:
|
||||
\#
|
||||
\#\c %macro foo 1-3
|
||||
\#\c ; Do something
|
||||
\#\c %if<condition>
|
||||
\#\c %exitmacro
|
||||
\#\c %endif
|
||||
\#\c ; Do something
|
||||
\#\c %endmacro
|
||||
|
||||
\H{condasm} \i{Conditional Assembly}\I\c{%if}
|
||||
|
||||
|
|
11
preproc.c
11
preproc.c
|
@ -2080,6 +2080,17 @@ static int do_directive(Token * tline)
|
|||
|
||||
i = pp_token_hash(tline->text);
|
||||
|
||||
/*
|
||||
* FIXME: We zap execution of PP_RMACRO, PP_IRMACRO, PP_EXITMACRO
|
||||
* since they are known to be buggy at moment, we need to fix them
|
||||
* in future release (2.09-2.10)
|
||||
*/
|
||||
if (i == PP_RMACRO || i == PP_RMACRO || i == PP_EXITMACRO) {
|
||||
error(ERR_NONFATAL, "unknown preprocessor directive `%s'",
|
||||
tline->text);
|
||||
return NO_DIRECTIVE_FOUND;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we're in a non-emitting branch of a condition construct,
|
||||
* or walking to the end of an already terminated %rep block,
|
||||
|
|
Loading…
Reference in a new issue