flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > If ~defined ?

Author
Thread Post new topic Reply to topic
celtic88



Joined: 26 Mar 2018
Posts: 4

If ~defined ?

Very Happy hi all

I'm trying to use "if defined" to check if the "external symbol" is already defined but compilation have a error !

any help thank you.


Code:
format MS COFF

;extrn _GetModuleHandleW@4
If ~defined _GetModuleHandleW@4
extrn _GetModuleHandleW@4
End If

public mTest
section '.code' code readable executable align 4096

mTest:

push dword 0
call _GetModuleHandleW@4           

Post 26 Mar 2018, 18:59
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6825
Location: Kraków, Poland

Because fasm allows symbols to be freely forward-referenced, putting a symbol definition inside an "if ~defined" block like that is a self-contradictory statement. You can find an explanation of how to handle this in the section 2.2.6 of the manual.
Post 26 Mar 2018, 19:44
View user's profile Send private message Visit poster's website 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


Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2018, Tomasz Grysztar.
Powered by rwasa.