flat assembler
Message board for the users of flat assembler.

Index > Main > If ~defined ?

Author
Thread Post new topic Reply to topic
celtic88



Joined: 26 Mar 2018
Posts: 6
celtic88 26 Mar 2018, 18:59
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



Joined: 16 Jun 2003
Posts: 8349
Location: Kraków, Poland
Tomasz Grysztar 26 Mar 2018, 19:44
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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.