Pelles C forum

Pelles C => Bug reports => Topic started by: Vortex on May 01, 2025, 07:10:56 PM

Title: Procedure declarations through macros
Post by: Vortex on May 01, 2025, 07:10:56 PM
Hello,

I am intending to work on a macro handling procedure definitions to store rcx,rdx,r8 and r9 in the shadow space.

For the the moment, the macro is very simple :

xPROC MACRO var

var

ENDM

Testing the macro, I receive the following error messages :

xPROC <DlgProc PROC hWnd:QWORD,uMsg:QWORD,wParam:QWORD,lParam:QWORD PARMAREA=12*SIZEOF QWORD>\PellesC\bin\poasm /AAMD64 ColorDlg.asm
ColorDlg.asm(33): error: Invalid use of '< >'.
ColorDlg.asm(35): error: Invalid use of 'LOCAL'.
ColorDlg.asm(35): fatal error: Invalid use of '_hWnd'.

Tested with Poasm Version 13.00.49
Title: Re: Procedure declarations through macros
Post by: Vortex on May 02, 2025, 10:50:18 AM
Hello,

Testing this code :

xPROC MACRO func,var

func PROC var

ENDM

xPROC DlgProc,<hWnd:QWORD,uMsg:QWORD,wParam:QWORD,lParam:QWORD PARMAREA=12*SIZEOF QWORD>

LOCAL _hWnd:QWORD

    mov _hWnd,rcx

The output is :
\PellesC\bin\poasm /AAMD64 ColorDlg.asm
ColorDlg.asm(5): error: Redefinition of symbol 'DlgProc'.
ColorDlg.asm(35): error: Invalid use of 'LOCAL'.
ColorDlg.asm(35): fatal error: Invalid use of '_hWnd'.
Title: Re: Procedure declarations through macros
Post by: Vortex on May 09, 2025, 01:26:16 PM
Hello,

I think we care ignore the case of macros declarating procedures. There is a workaround.