Skip to content

Commit 8de66e9

Browse files
author
H. Peter Anvin
committed
doc: replace %define with %xdefine in some preproc function examples
In some of the preprocessor function examples, actually enforce equivalence by using %xdefine in the function examples so the expansion is at definition time. Signed-off-by: H. Peter Anvin <[email protected]>
1 parent 51ad8e1 commit 8de66e9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

doc/nasmdoc.src

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,9 +2904,9 @@ Being a function, the argument will need to have balanced parentheses
29042904
or be escaped using \c{\{\}}.
29052905

29062906
\c ; The following lines are all equivalent
2907-
\c %define test 'TEST'
2908-
\c %defstr test TEST
2909-
\c %define test %str(TEST)
2907+
\c %define test 'TEST'
2908+
\c %defstr test TEST
2909+
\c %xdefine test %str(TEST)
29102910

29112911

29122912
\S{f_strcat} \i\c\{%strcat()} Function
@@ -2915,9 +2915,9 @@ The \c{%strcat()} function concatenates a list of quoted strings, in
29152915
the same way the \i\c{%strcat} directive would, see \k{strcat}.
29162916

29172917
\c ; The following lines are all equivalent
2918-
\c %define alpha 'Alpha: 12" screen'
2919-
\c %strcat alpha "Alpha: ", '12" screen'
2920-
\c %define alpha %strcat("Alpha: ", '12" screen')
2918+
\c %define alpha 'Alpha: 12" screen'
2919+
\c %strcat alpha "Alpha: ", '12" screen'
2920+
\c %xdefine alpha %strcat("Alpha: ", '12" screen')
29212921

29222922

29232923
\S{f_strlen} \i\c{%strlen()} Function
@@ -2926,9 +2926,9 @@ The \c{%strlen()} function expands to the length of a quoted string,
29262926
in the same way the \i\c{%strlen} directive would, see \k{strlen}.
29272927

29282928
\c ; The following lines are all equivalent
2929-
\c %define charcnt 9
2930-
\c %strlen charcnt 'my string'
2931-
\c %define charcnt %strlen('my string')
2929+
\c %define charcnt 9
2930+
\c %strlen charcnt 'my string'
2931+
\c %xdefine charcnt %strlen('my string')
29322932

29332933

29342934
\S{f_substr} \i\c\{%substr()} Function
@@ -2939,9 +2939,9 @@ that unlike the \c{%substr} directive, a comma is required after the
29392939
string argument.
29402940

29412941
\c ; The following lines are all equivalent
2942-
\c %define mychar 'yzw'
2943-
\c %substr mychar 'xyzw' 2,-1
2944-
\c %define mychar %substr('xyzw',2,-1)
2942+
\c %define mychar 'yzw'
2943+
\c %substr mychar 'xyzw' 2,-1
2944+
\c %xdefine mychar %substr('xyzw',2,-1)
29452945

29462946

29472947
\S{f_tok} \i\c{%tok()} function

0 commit comments

Comments
 (0)