flat assembler
Message board for the users of flat assembler.
Index
> Main > Use of "select" |
Author |
|
LocoDelAssembly 20 Jun 2011, 20:51
select. Since by using win32ax.inc you're automatically including wsock32.inc you get the clash (note that this doesn't mean your application imports from wsock32 if no function is used).
I hope I understood what you meant, it would be better if you include at least a few lines of code to see the reference you mention. |
|||
20 Jun 2011, 20:51 |
|
AsmGuru62 21 Jun 2011, 02:39
I had this strange thing once. If any of the predefined macros from FASM header files will be used in a place of your own functions, labels, etc. it may produce the clash. Simply rename the clashing keyword - call it Select<something> to be more readable and avoid the clash.
|
|||
21 Jun 2011, 02:39 |
|
Crinan 21 Jun 2011, 03:45
LocoDelAssembly:
I'm afraid I don't understand your reply. Here is a super-simple example of what I mean. include '\Fasm\Include\win32ax.inc' start: call select invoke ExitProcess,0 select: ret AsmGuru62: Yes, I did rename the reference, but I don't know what the clash might have been. |
|||
21 Jun 2011, 03:45 |
|
revolution 21 Jun 2011, 03:49
"select" is a Win32 API name.
It is used in the Winsock API. So when you include 'win32ax.inc' you also get 'wsock32.inc'. And 'wsock32.inc' defines the label "select". So when you try to define the label "select" there is a clash with the definition inside 'wsock32.inc'. |
|||
21 Jun 2011, 03:49 |
|
Crinan 21 Jun 2011, 05:30
Thanks Revolution - that explains the situation.
|
|||
21 Jun 2011, 05:30 |
|
AsmGuru62 21 Jun 2011, 13:41
btw, the worst thing is that FASM gives incorrect error message - something completely different than what is going on. It should simply say on the line where I define the function: "<name>: identifier already defined". Maybe Tomasz will see this post and fix it?..
|
|||
21 Jun 2011, 13:41 |
|
LocoDelAssembly 21 Jun 2011, 18:17
AsmGuru62, the problem is that it is actually the includes that are redifining since the "offending line" in wsock32.inc doesn't gets assembled until the programmer uses the ".end entry_point" macro invocation which happens at the end of the source (i.e. after "select:ret").
Still, what you say is somewhat doable by using this inside the official includes: Code: if defined label err `label "is an API function which is clashing with some label in your code" end if |
|||
21 Jun 2011, 18:17 |
|
AsmGuru62 22 Jun 2011, 01:05
Good point.
I have IDE which generates code, so I have all the function entries, locals - all generated, so I do not use the end macro. That is why the message was so cryptic. |
|||
22 Jun 2011, 01:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.