flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Broken Macro since v1.60

Author
Thread Post new topic Reply to topic
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
I've been using this conditional compilation macro trick, as posted by Privalov himself:

Code:
macro define name { name fix defined }
macro ifdef name,condmacro,elsemacro
{
   macro ifdef#name _m elsemacro m_
   macro ifdef#defined _m condmacro m_
   ifdef#name
   purge ifdef#defined
   purge ifdef#name
}

_m fix {
m_ fix }
    


I use it in this context:
Code:
include "options.inc"
ifdef _RELEASE,include "include/release.inc",include "include/debug.inc"
    


where options.inc has a single-line: define _RELEASE (or it does not have that line at all).

Everything compiles fine on 1.60, but breaks after. I have only be able to test 1.60 and 1.62, as I have no builds in between those two.

I know there is a new define directive in 1.66, but it should not be a problem since I was actually testing 1.62.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 01 Jun 2006, 05:01
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
The compile error I get is:
Quote:

ifdef _RELEASE,include "include/release.inc",include "include/debug.inc"
include/macro/macros.inc [199] ifdef [1]:
macro ifdef#name _m elsemacro m_
error: invalid macro arguments.
Post 01 Jun 2006, 05:03
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
I switched to using the match directive, but I am still wondering why the above macro can't compile.
Post 01 Jun 2006, 05:17
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7752
Location: Kraków, Poland
Tomasz Grysztar
Post 01 Jun 2006, 06:43
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
because of fix
Post 01 Jun 2006, 06:58
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
What about fix?
Post 01 Jun 2006, 17:06
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
It is processed BEFORE all other preprocessing. So:

Code:
macro define name { name fix defined }    
will not expand, since fix is processed BEFORE the preprocessing stage ("macro" for example). It's like:

Code:
name fix defined
macro define name { }    
in fact, you could put fix anywhere and it wouldn't affect that macro. But it would affect the following data, if it uses that name ("name" in our case).
Post 01 Jun 2006, 17:20
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Post 01 Jun 2006, 17:26
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
Thanks
Post 01 Jun 2006, 21:00
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.