[futurebasic] Re: [FB] FB4 compiler bug - Attn: RP

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2008 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Wed, 30 Apr 2008 18:52:39 +1200
Scott Hochberg wrote:

> Anyway, I recently updated my FB to the current version, and that  
> included the revised version of that include file.
> When I compile for Carbon, it works fine, but when I compile for  
> PPC, that include fails.
> The problem is an undimmed variable (sColorSearchUPP) in Line 423.   
> I notice that the variable was dimmed in the revision just above  
> that line, but only dimmed within an #if CarbonLib section. The  
> statement where the variable is used is outside of that statement,  
> making the variable undeclared when not compiling for Carbon.

This is not a compiler bug, just a Headers file snafu.
In the FB Headers file Subs Graphics.incl, function RUNTIME FBFill,  
locate the code block after 'long if BaseAddr&' (between two thick  
black lines).
Try changing it to:

'~'2
// fix for PPC & CarbonLib - rp 20080430
begin globals
dim as proc sColorSearchUPP
end globals
#if CarbonLib
// Leak plug - RP 24 Feb 2007
if ( sColorSearchUPP == 0 ) then sColorSearchUPP = fn  
NewColorSearchUPP( [proc "MySeedCFillMatchProc" +  
_FBprocToProcPtrOffset] )
#else
sColorSearchUPP = proc "MySeedCFillMatchProc"
#endif
'~'2

I'm a little surprised that anyone is still compiling for obsolete PPC  
format. I can't even test the code above, having only an Intel Mac.  
However it does Trial Compile with error.

Robert P.