I found a minor bug in the allow_nesting macro. When recompiling my opengl examples, fasmw kept giving me an illegal parameter error, even though the parameter count was correct. So with a little snooping around in the fasmw macro files, I found the error. In the allow_nesting macro there is a line that simply has the word 'err' on it, commenting out this line solves the problem. It seems to only happen when using the invoke macro's double keyword to pass double floats to a function.
See code below to see where to fix this, goto where the invoke and stdcall macro are defined:
macro allow_nesting
{ macro pushd value
\{ match ,value \\{
pushx equ \\}
match =pushx =invoke proc,pushx value \\{
allow_nesting
invoke proc
purge pushd,invoke,stdcall,cinvoke,ccall
push eax
pushx equ \\}
match =pushx =stdcall proc,pushx value \\{
allow_nesting
stdcall proc
purge pushd,invoke,stdcall,cinvoke,ccall
push eax
pushx equ \\}
match =pushx =cinvoke proc,pushx value \\{
allow_nesting
cinvoke proc
purge pushd,invoke,stdcall,cinvoke,ccall
push eax
pushx equ \\}
match =pushx =ccall proc,pushx value \\{
allow_nesting
ccall proc
purge pushd,invoke,stdcall,cinvoke,ccall
push eax
pushx equ \\}
match =pushx,pushx \\{
pushd <value>
pushx equ \\}
restore pushx \}
macro invoke proc,[arg]
\{ \common count@stdcall = 0
if ~ arg eq
\forward count@stdcall = count@stdcall+1
match =double value, arg \\{ count@stdcall = count@stdcall+1 \\}
\common end if
if defined proc \# %
if count@stdcall <> proc \# %
display "Error: invalid count of parameters for ",\`proc,".",0Dh,0Ah
err ; <- [***COMMENT THIS LINE OUT***]
end if
end if
\reverse pushd <arg>
\common call [proc] \}
macro stdcall proc,[arg]
\{ \common count@stdcall = 0
if ~ arg eq
\forward count@stdcall = count@stdcall+1
match =double value, arg \\{ count@stdcall = count@stdcall+1 \\}
\common end if
if defined proc \# %
if count@stdcall <> proc \# %
display "Error: invalid count of parameters for ",\`proc,".",0Dh,0Ah
err ; <- [***COMMENT THIS LINE OUT***]
end if
end if
\reverse pushd <arg>
\common call proc \}
macro cinvoke proc,[arg]
\{ \common \local size
size = 0
if ~ arg eq
\reverse pushd <arg>
size = size+4
match =double any,arg \\{ size = size+4 \\}
\common end if
call [proc]
if size
add esp,size
end if \}
macro ccall proc,[arg]
\{ \common \local size
size = 0
if ~ arg eq
\reverse pushd <arg>
size = size+4
match =double any,arg \\{ size = size+4 \\}
\common end if
call proc
if size
add esp,size
end if \} }