Skip to content

Commit b477477

Browse files
authored
Merge pull request #101 from marpon/master
Cleaned request __FB_GUI__ intrinsic define
2 parents 6c65ce2 + 85d80fe commit b477477

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

src/compiler/fb.bas

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ sub fbGlobalInit()
480480
env.clopt.stacksize = FB_DEFSTACKSIZE
481481
env.clopt.objinfo = TRUE
482482
env.clopt.showincludes = FALSE
483+
env.clopt.modeview = FB_DEFAULT_MODEVIEW
483484

484485
hUpdateLangOptions( )
485486
hUpdateTargetOptions( )
@@ -571,6 +572,8 @@ sub fbSetOption( byval opt as integer, byval value as integer )
571572
env.clopt.objinfo = value
572573
case FB_COMPOPT_SHOWINCLUDES
573574
env.clopt.showincludes = value
575+
case FB_COMPOPT_MODEVIEW
576+
env.clopt.modeview = value
574577
end select
575578
end sub
576579

@@ -643,6 +646,8 @@ function fbGetOption( byval opt as integer ) as integer
643646
function = env.clopt.objinfo
644647
case FB_COMPOPT_SHOWINCLUDES
645648
function = env.clopt.showincludes
649+
case FB_COMPOPT_MODEVIEW
650+
function = env.clopt.modeview
646651

647652
case else
648653
function = 0

src/compiler/fb.bi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,18 @@ enum FB_COMPOPT
9292
FB_COMPOPT_STACKSIZE '' integer
9393
FB_COMPOPT_OBJINFO '' boolean: write/read .fbctinf sections etc.?
9494
FB_COMPOPT_SHOWINCLUDES '' boolean: -showincludes
95+
FB_COMPOPT_MODEVIEW ''__FB_GUI__
9596

9697
FB_COMPOPTIONS
9798
end enum
9899

100+
enum FB_MODEVIEW
101+
FB_MODEVIEW_CONSOLE = 0
102+
FB_MODEVIEW_GUI
103+
end enum
104+
105+
const FB_DEFAULT_MODEVIEW = FB_MODEVIEW_CONSOLE
106+
99107
'' pedantic checks
100108
enum FB_PDCHECK
101109
FB_PDCHECK_NONE = &h00000000
@@ -265,6 +273,7 @@ type FBCMMLINEOPT
265273
stacksize as integer
266274
objinfo as integer
267275
showincludes as integer
276+
modeview as FB_MODEVIEW
268277
end type
269278

270279
'' features allowed in the selected language

src/compiler/fbc.bas

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ private function hLinkFiles( ) as integer
924924
ldcline += hFindLib( "crtend.o" )
925925

926926
end select
927-
927+
928928
if( fbGetOption( FB_COMPOPT_TARGET ) = FB_COMPTARGET_DARWIN ) then
929929
ldcline += " -macosx_version_min 10.6"
930930
end if
@@ -1755,6 +1755,9 @@ private sub handleOpt(byval optid as integer, byref arg as string)
17551755

17561756
case OPT_S
17571757
fbc.subsystem = arg
1758+
select case( arg )
1759+
case "gui" : fbSetOption( FB_COMPOPT_MODEVIEW, FB_MODEVIEW_GUI )
1760+
end select
17581761

17591762
case OPT_SHOWINCLUDES
17601763
fbSetOption( FB_COMPOPT_SHOWINCLUDES, TRUE )
@@ -3203,7 +3206,7 @@ private sub hAddDefaultLibs( )
32033206
defined(__FB_NETBSD__)
32043207
fbcAddDefLibPath( "/usr/X11R6/lib" )
32053208
#endif
3206-
3209+
32073210
#if defined(__FB_DARWIN__) and defined(ENABLE_XQUARTZ)
32083211
fbcAddDefLibPAth( "/opt/X11/lib" )
32093212
#endif

src/compiler/symb-define.bas

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ private function hDefOptGosub_cb ( ) as string
8686
function = str( env.opt.gosub = TRUE )
8787
end function
8888

89+
private function hDefGui_cb ( ) as string
90+
function = str( env.clopt.modeview = FB_MODEVIEW_GUI )
91+
end function
92+
8993
private function hDefOutExe_cb ( ) as string
9094
function = str( env.clopt.outtype = FB_OUTTYPE_EXECUTABLE )
9195
end function
@@ -208,7 +212,8 @@ dim shared defTb(0 to ...) as SYMBDEF => _
208212
(@"__FB_BACKEND__" , NULL , FB_DEFINE_FLAGS_STR, @hDefBackend_cb ), _
209213
(@"__FB_FPU__" , NULL , FB_DEFINE_FLAGS_STR, @hDefFpu_cb ), _
210214
(@"__FB_FPMODE__" , NULL , FB_DEFINE_FLAGS_STR, @hDefFpmode_cb ), _
211-
(@"__FB_GCC__" , NULL , 0 , @hDefGcc_cb ) _
215+
(@"__FB_GCC__" , NULL , 0 , @hDefGcc_cb ), _
216+
(@"__FB_GUI__" , NULL , 0 , @hDefGui_cb ) _
212217
}
213218

214219
sub symbDefineInit _

0 commit comments

Comments
 (0)