invoke macro simulator - updated

Started by Vortex, October 24, 2006, 07:50:29 PM

Previous topic - Next topic

PBrennick

Thanks Vortex, it will be in the next update of the GeneSys SDK.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

Vortex

This new version creates the functions prototypes :


_invoke MACRO FuncName:REQ,args:VARARG

LOCAL counter,params,StringSize
params TEXTEQU <>
counter = 0

    FOR param,<args>

        counter=counter+1

    ENDM

;   IFNDEF FuncName

        IF counter

            REPEAT counter
                params CATSTR params,<:DWORD,>
            ENDM

            params SUBSTR params,1,@SizeStr(%params)-1

        ENDIF

        FuncName PROTO STDCALL params

;   ENDIF

    IF counter
        invoke  FuncName,args
    ELSE
        invoke  FuncName
    ENDIF

ENDM

cinvoke MACRO FuncName:REQ,args:VARARG

LOCAL counter
counter = 0

    FOR param,<args>

        counter=counter+1

    ENDM

;   IFNDEF FuncName

        FuncName PROTO C :VARARG

;   ENDIF

    IF counter
        invoke  FuncName,args
    ELSE
        invoke  FuncName
    ENDIF

ENDM



[attachment deleted by admin]