Skip to content

Commit 85d80fe

Browse files
committed
__FB_GUI__ Cleaned
My last cleaned version hope it works now only 1 define as console is default mode, compiled ok with 32 and 64 tested with #if FB_GUI #include "windows.bi" messagebox(0, "Gui mode", "info",0) #else print "Console mode" print : print "Any key to close" sleep #endif
1 parent 6ce4a74 commit 85d80fe

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

src/compiler/fb.bas

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ 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 '***** console/gui
484-
483+
env.clopt.modeview = FB_DEFAULT_MODEVIEW
484+
485485
hUpdateLangOptions( )
486486
hUpdateTargetOptions( )
487487
end sub
@@ -572,8 +572,8 @@ sub fbSetOption( byval opt as integer, byval value as integer )
572572
env.clopt.objinfo = value
573573
case FB_COMPOPT_SHOWINCLUDES
574574
env.clopt.showincludes = value
575-
case FB_COMPOPT_MODEVIEW '***** console/gui
576-
env.clopt.modeview = value '***** console/gui
575+
case FB_COMPOPT_MODEVIEW
576+
env.clopt.modeview = value
577577
end select
578578
end sub
579579

@@ -646,9 +646,9 @@ function fbGetOption( byval opt as integer ) as integer
646646
function = env.clopt.objinfo
647647
case FB_COMPOPT_SHOWINCLUDES
648648
function = env.clopt.showincludes
649-
case FB_COMPOPT_MODEVIEW '***** console/gui
650-
function = env.clopt.modeview '***** console/gui
651-
649+
case FB_COMPOPT_MODEVIEW
650+
function = env.clopt.modeview
651+
652652
case else
653653
function = 0
654654
end select

src/compiler/fb.bi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ 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 '' new for console gui '***** console/gui
96-
95+
FB_COMPOPT_MODEVIEW ''__FB_GUI__
96+
9797
FB_COMPOPTIONS
9898
end enum
9999

100-
enum FB_MODEVIEW '***** console/gui
101-
FB_MODEVIEW_ISCONSOLE = 0 '***** console/gui
102-
FB_MODEVIEW_ISGUI '***** console/gui
103-
end enum '***** console/gui
100+
enum FB_MODEVIEW
101+
FB_MODEVIEW_CONSOLE = 0
102+
FB_MODEVIEW_GUI
103+
end enum
104104

105-
const FB_DEFAULT_MODEVIEW = FB_MODEVIEW_ISCONSOLE '***** console/gui
105+
const FB_DEFAULT_MODEVIEW = FB_MODEVIEW_CONSOLE
106106

107107
'' pedantic checks
108108
enum FB_PDCHECK
@@ -273,7 +273,7 @@ type FBCMMLINEOPT
273273
stacksize as integer
274274
objinfo as integer
275275
showincludes as integer
276-
modeview as FB_MODEVIEW
276+
modeview as FB_MODEVIEW
277277
end type
278278

279279
'' features allowed in the selected language

src/compiler/fbc.bas

Lines changed: 5 additions & 5 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,9 +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 ) '***** console/gui
1759-
case "gui" : fbSetOption( FB_COMPOPT_MODEVIEW, FB_MODEVIEW_ISGUI ) '***** console/gui
1760-
end select
1758+
select case( arg )
1759+
case "gui" : fbSetOption( FB_COMPOPT_MODEVIEW, FB_MODEVIEW_GUI )
1760+
end select
17611761

17621762
case OPT_SHOWINCLUDES
17631763
fbSetOption( FB_COMPOPT_SHOWINCLUDES, TRUE )
@@ -3206,7 +3206,7 @@ private sub hAddDefaultLibs( )
32063206
defined(__FB_NETBSD__)
32073207
fbcAddDefLibPath( "/usr/X11R6/lib" )
32083208
#endif
3209-
3209+
32103210
#if defined(__FB_DARWIN__) and defined(ENABLE_XQUARTZ)
32113211
fbcAddDefLibPAth( "/opt/X11/lib" )
32123212
#endif

src/compiler/symb-define.bas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ end function
8585
private function hDefOptGosub_cb ( ) as string
8686
function = str( env.opt.gosub = TRUE )
8787
end function
88-
89-
private function hDefViewGui_cb ( ) as string '***** console/gui
90-
function = str( env.clopt.modeview = FB_MODEVIEW_ISGUI )
88+
89+
private function hDefGui_cb ( ) as string
90+
function = str( env.clopt.modeview = FB_MODEVIEW_GUI )
9191
end function
92-
92+
9393
private function hDefOutExe_cb ( ) as string
9494
function = str( env.clopt.outtype = FB_OUTTYPE_EXECUTABLE )
9595
end function
@@ -213,7 +213,7 @@ dim shared defTb(0 to ...) as SYMBDEF => _
213213
(@"__FB_FPU__" , NULL , FB_DEFINE_FLAGS_STR, @hDefFpu_cb ), _
214214
(@"__FB_FPMODE__" , NULL , FB_DEFINE_FLAGS_STR, @hDefFpmode_cb ), _
215215
(@"__FB_GCC__" , NULL , 0 , @hDefGcc_cb ), _
216-
(@"__FB_GUI__" , NULL , 0 , @hDefViewGui_cb ) _ '***** console/gui
216+
(@"__FB_GUI__" , NULL , 0 , @hDefGui_cb ) _
217217
}
218218

219219
sub symbDefineInit _

0 commit comments

Comments
 (0)