@@ -148,6 +148,10 @@ type FBCTOOLINFO
148148 path as zstring * (FB_MAXPATHLEN + 1 )
149149end type
150150
151+ #define fbctoolGetFlags( tool, f ) ((fbctoolTB( tool ).flags and (f)) <> 0 )
152+ #define fbctoolSetFlags( tool, f ) fbctoolTB( tool ).flags or = f
153+ #define fbctoolUnsetFlags( tool, f ) fbctoolTB( tool ).flags and = not f
154+
151155'' must be same order as enum FBCTOOL
152156static shared as FBCTOOLINFO fbctoolTB( 0 to FBCTOOL__COUNT- 1 ) = _
153157{ _
@@ -171,8 +175,7 @@ static shared as FBCTOOLINFO fbctoolTB(0 to FBCTOOL__COUNT-1) = _
171175declare sub fbcFindBin _
172176 ( _
173177 byval tool as integer , _
174- byref path as string , _
175- byref relying_on_system as integer = FALSE _
178+ byref path as string _
176179 )
177180
178181#macro safeKill(f)
@@ -410,18 +413,16 @@ end sub
410413private sub fbcFindBin _
411414 ( _
412415 byval tool as integer , _
413- byref path as string , _
414- byref relying_on_system as integer _
416+ byref path as string _
415417 )
416418
417419 '' Re-use path from last time if possible
418- if ( ( fbctoolTB( tool ).flags and FBCTOOLFLAG_FOUND ) <> 0 ) then
420+ if ( fbctoolGetFlags( tool, FBCTOOLFLAG_FOUND ) ) then
419421 path = fbctoolTB( tool ).path
420- relying_on_system = ((fbctoolTB( tool ).flags and FBCTOOLFLAG_RELYING_ON_SYSTEM) <> 0 )
421422 exit sub
422423 end if
423424
424- relying_on_system = FALSE
425+ fbctoolUnsetFlags( tool, FBCTOOLFLAG_RELYING_ON_SYSTEM )
425426
426427 '' a) Use the path from the corresponding environment variable if it's set
427428 if ( (fbctoolTB(tool).flags and FBCTOOLFLAG_CAN_USE_ENVIRON) <> 0 ) then
@@ -450,17 +451,13 @@ private sub fbcFindBin _
450451 else
451452 path = fbctoolTB(tool).name
452453 end if
453- relying_on_system = TRUE
454+ fbctoolSetFlags( tool, FBCTOOLFLAG_RELYING_ON_SYSTEM )
454455 end if
455456 # endif
456457 end if
457458
458-
459459 fbctoolTB( tool ).path = path
460- fbctoolTB( tool ).flags or = FBCTOOLFLAG_FOUND
461- fbctoolTB( tool ).flags = iif( relying_on_system, _
462- fbctoolTB( tool ).flags or FBCTOOLFLAG_RELYING_ON_SYSTEM, _
463- fbctoolTB( tool ).flags and not FBCTOOLFLAG_RELYING_ON_SYSTEM )
460+ fbctoolSetFlags( tool, FBCTOOLFLAG_FOUND )
464461end sub
465462
466463private function fbcRunBin _
@@ -470,10 +467,10 @@ private function fbcRunBin _
470467 byref ln as string _
471468 ) as integer
472469
473- dim as integer result = any, relying_on_system = any
470+ dim as integer result = any
474471 dim as string path
475472
476- fbcFindBin( tool, path, relying_on_system )
473+ fbcFindBin( tool, path )
477474
478475 if ( fbc.verbose ) then
479476 print *action + ": " , path + " " + ln
@@ -486,7 +483,7 @@ private function fbcRunBin _
486483 result = exec( path, ln )
487484 # else
488485 '' Found at bin/?
489- if ( relying_on_system = FALSE ) then
486+ if ( fbctoolGetFlags( tool, FBCTOOLFLAG_RELYING_ON_SYSTEM ) = FALSE ) then
490487 result = exec( path, ln )
491488 else
492489 result = shell( path + " " + ln )
0 commit comments