flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > include once

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 15 Dec 2015, 14:19
l_inc wrote:
revolution
Quote:
Because Linux, Unix and Windows would break the code in different ways due to case and path differences.

Provide an example. Without it it seems you are just ignoring what I say.
Code:
include 'c:\code\uberstuff.inc' ;<--- Linux can open this?    
Post 15 Dec 2015, 14:19
View user's profile Send private message Visit poster's website Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 15 Dec 2015, 14:24
Post 15 Dec 2015, 14:24
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 15 Dec 2015, 14:30
revolution
I didn't say, one should use full paths, but your suggestion is to introduce many more limitations. Say there's a library that includes its files using relative paths (similar to win32a.inc). Some files can be included as a part of the library or individually. The relative paths would be different. How restrictive should be your rules to avoid this?

That's not mentioning that soft and hard links are possible in both Windows and Linux. Taking that into account shows that C-style inclusion duplication prevention is the only correct way. Just consider what you'd do to compile a project making use of soft links on a system that has no support for them.

_________________
Faith is a superposition of knowledge and fallacy
Post 15 Dec 2015, 14:30
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 15 Dec 2015, 16:41
l_inc wrote:
That's not mentioning that soft and hard links are possible in both Windows and Linux. Taking that into account shows that C-style inclusion duplication prevention is the only correct way. Just consider what you'd do to compile a project making use of soft links on a system that has no support for them.
I agree. I never said this was a proper or complete solution. It is not. But if one wants to make to most of it then such self restrictions can help to make it less error prone to use.
Post 15 Dec 2015, 16:41
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 15 Dec 2015, 19:16
revolution
I have nothing against some rules of project organization. I'm just saying that the only reason to implement "include once" natively is the ability to unambiguously identify files, and if even this advantage is ignored, then it's just useless.

_________________
Faith is a superposition of knowledge and fallacy
Post 15 Dec 2015, 19:16
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 16 Dec 2015, 06:25
Again, once is a user-typed hint to overcome standard behaviour of fasm.
It does nothing to fasm structures, keeping inclusion order as described in official manual.
What it really does: when fasm is just about including a file, once checks for its presence and does its job.
Post 16 Dec 2015, 06:25
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 21 Nov 2017, 16:55
hi, just updated to 1.72
esp tnx to TG for keeping include logics same
Post 21 Nov 2017, 16:55
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 23 Feb 2021, 18:38
Damn!..
I'm glad to see you again!
According the topic, i solved to automate patching process.
The only condition - the Author not to change inclusion logics.
Right now it is 2/3 complete.
There it is.
And the stumble: how to analize preproce.inc guys?
Do we need to read&trim lines, or tokenize(that is heavy), extract lexems, how to mind the style (e.g. was movsb, became movs byte [etc]), or should we detect inclusion code and replace it all.
I donot know.
Tnx!
Post 23 Feb 2021, 18:38
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 24 Feb 2021, 23:30
Post 24 Feb 2021, 23:30
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 28 Feb 2021, 19:21
include once useless now.

test_it.asm:
Code:
include 'file_to_include_once.inc'
include 'file_that_includes_the_file_to_include_once.inc'
call something_from_this_once_file
call something_from_the_second_file
    


file_to_include_once.inc:
Code:
if ~ definite FileToIncludeOnceStillIncluded
...
end if
FileToIncludeOnceStillIncluded=0
    

file_that_includes_the_file_to_include_once.inc:
Code:
include 'file_that_includes_the_file_to_include_once.inc'
call something_from_the_once_file
    


definite keyword is a new feature and i like it.
Post 28 Feb 2021, 19:21
View user's profile Send private message Visit poster's website Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 28 Feb 2021, 19:41
I gues defined (i must admit i have not coded since 2017) )


Glad to meet you, edfed, again.
Post 28 Feb 2021, 19:41
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 28 Feb 2021, 21:37
that's not defined, i've tested to make include guards with this statement but it don't works at all cause it doesn't care if defined before or after, it tests the entire source before to return a result.

with definite, you can make the distinction between before and after definitions.

glad to come back here too... finally i've got time and projects to code with fasm again.
Post 28 Feb 2021, 21:37
View user's profile Send private message Visit poster's website Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 23 Mar 2021, 21:33
Updated.
I hope it helps/serves/useful.


Description:
Filesize: 44.93 KB
Viewed: 11056 Time(s)

We won the lottery.png


Post 23 Mar 2021, 21:33
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 17 Dec 2023, 19:40
hi
updated to fasmw17332
esp tnx to the Author for keeping inclusion logics same - i just ran a script,recompiled,packed
Post 17 Dec 2023, 19:40
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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.