Download Pelles C here: http://www.smorgasbordet.com/pellesc/
.386
.model flat,stdcall
option casemap:none
sample MACRO var
LOCAL t,temp
t INSTR <var>,<macro>
temp TEXTEQU %(t)
% echo temp
temp TEXTEQU %(@InStr(t+1,<var>,<test>))
% echo temp
ENDM
.code
start:
sample <This is a macro test.>
xor eax,eax
ret
END start
#define _UNICODE
#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>
#include <tchar.h>
int main(void)
{
wchar_t szPath[1024];
wchar_t arguments[1024];
wcscpy(szPath, L"Testing");
swprintf_s(arguments, 1024, L"\"%s\"", szPath);
return 0;
}
Quote from: Quin on April 28, 2025, 10:52:57 AMThe only use case I see for this in C is, for example, accessing a global variable with the same name as a local.No, please don't misunderstand me, I'm not interested in language or compiler changes.
#define :: _
window_input_keyboard_process(); //Which namespace(s) is this?
window::input::keyboard_process(); //Now it's obvious, but compiler still sees underscores
\PellesC\bin\poasm.exe /AIA32 Sample.asm
11
Sample.asm(12): error: Expected ','.
Sample.asm(12): error: Expected ','.
Sample.asm(12): error: Expected ')'.
01, <This is a macro test.>, <test>Sample.asm(12): fatal error: Invalid use of ')'.
.386
.model flat,stdcall
option casemap:none
sample MACRO var
LOCAL t
t INSTR var,<macro>
.echo t
.echo @InStr(t+1,var,<test>)
ENDM
.code
start:
sample <This is a macro test.>
xor eax,eax
ret
END start
Page created in 3.115 seconds with 15 queries.