It is currently Thu Nov 26, 2020 2:26 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [Done] 5.46 XIncludeFile trying to include multiple times?
PostPosted: Wed Nov 20, 2019 2:30 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1259
Location: germany
Hi,

I just set up a new MacOS Catalina development machine and my PureBasic source does no longer compile. The compiler is re-including the same files multiple times even if used XIncludeFile. I do not have this problem with the same compiler on another Machine and also not on Windows and Linux. Only on this machine.

Any idea what might be wrong? Something that makes XIncludeFile forget its previous sources values?

main.pb:
Code:
XIncludeFile #RF_INCLUDES + "pb/src/Utils.pbi"
XIncludeFile #RF_INCLUDES + "Logging.pbi"
...

Utils.pbi:
Code:
XIncludeFile #RF_INCLUDES + "pb/src/First.pbi"
...

Logging.pbi:
Code:
XIncludeFile #RF_INCLUDES + "pb/src/First.pbi"
...

First.pbi:
Code:
...
Macro API ; <-- error triggers here
; just a placeholder
EndMacro
...

This is what the compiler is saying:
Code:
******************************************
PureBasic 5.46 LTS (MacOS X - x64)
******************************************

Loading external modules...
Starting compilation...
Starting compilation...
Including source: /Users/volker/src/includes/pb/src/Utils.pbi
Including source: /Users/volker/src/includes/pb/src/First.pbi
Including source: /Users/volker/src/includes/pb/src/Logging.pbi
Including source: /Users/volker/src/includes/pb/src/First.pbi
Error: in included file '/Users/volkerschmid/src/includes/pb/src/First.pbi'
Line 213 - Syntax error.
at line 1 of the expanded macro (Macro.out)


while #RF_INCLUDES=/Users/volker/src/includes/.

As you can see, the compiler includes the First.pbi multiple times even using XIncludeFile. One from Utils.pbi and one from Logging.pbi. On my other machines this does not happen. With exactly the same source.

What is wrong here????


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.46 LTS] XIncludeFile trying to include multiple times
PostPosted: Wed Nov 20, 2019 5:23 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1259
Location: germany
Interestingly, with PB 5.71 it does not happen. But we need to stay with 5.46 for some months :-(

Is there a way to fix this in 5.46?


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.46 LTS] XIncludeFile trying to include multiple times
PostPosted: Wed Nov 20, 2019 9:40 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1863
Why do you need to stay with PB 5.46 ?

Anyway, there was a bug in some versions where XIncludeFile wasn't doing its job, that is it was including more than once. It was fixed but I can't find the Bug Report.

In your project some "include guards" should fix it, right?

Code:
CompilerIf (Not Defined(_ThisFile_Included, #PB_Constant))
#_ThisFile_Included = #True

Debug "Your Include Code Here"

CompilerEndIf


https://en.wikipedia.org/wiki/Include_guard

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.46 LTS] XIncludeFile trying to include multiple times
PostPosted: Thu Nov 21, 2019 8:09 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1259
Location: germany
Hi kenmo,

thanks, seems I'm able to use such guard instead of XIncludeFile. But I would have to verify and touch about 80 positions in code (I have a lot of includes in a big project). I also found that I get Illegal Instruction: 4 compiler errors in PB 5.46 on Catalina. So I think 5.46 is not really compatible with Catalina (https://www.purebasic.fr/english/viewtopic.php?f=24&t=74063).

I will have to switch to PB 5.71. With such change, it is very likely that some of the program functions may be affected by compiler changes or new bugs. I like to stay at a stable PB version as long as possible because I know that functions not touched will stay functional. By upgrading, I will have to initiate a complete new QA run for all functions on all platforms. This is expensive and costs time :-(


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.46 LTS] XIncludeFile trying to include multiple times
PostPosted: Sun Feb 02, 2020 10:28 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14179
Location: France
Unfortunaly, we don't fix anything on 5.46 anymore, I will close the report.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye