summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaul <paul@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-02-13 03:21:03 +0000
committerpaul <paul@3ad0048d-3df7-0310-abae-a5850022a9f2>2013-02-13 03:21:03 +0000
commit8d86caf83ca056aedfbebe1c7d1cc39982230f6e (patch)
tree07d9925b4d3e31c095707d9ec43ad7911e6870ab
parente4a19641e59aabf8cda252b32943d5bed4dda3c0 (diff)
downloadfpc-8d86caf83ca056aedfbebe1c7d1cc39982230f6e.tar.gz
compiler: set apptype using new SetAppType routine, add 'CONSOLE' define for console apptype.
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23603 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/options.pas28
-rw-r--r--compiler/scandir.pas14
-rw-r--r--compiler/scanner.pas9
-rw-r--r--compiler/systems/t_nds.pas2
4 files changed, 32 insertions, 21 deletions
diff --git a/compiler/options.pas b/compiler/options.pas
index faaa146d7e..62ec5066a7 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -1717,9 +1717,9 @@ begin
if target_info.system in systems_all_windows then
begin
if UnsetBool(More, j, opt, false) then
- apptype:=app_cui
+ SetApptype(app_cui)
else
- apptype:=app_native;
+ SetApptype(app_native);
end
else
IllegalPara(opt);
@@ -1729,9 +1729,9 @@ begin
if target_info.system in systems_darwin then
begin
if UnsetBool(More, j, opt, false) then
- apptype:=app_cui
+ SetApptype(app_cui)
else
- apptype:=app_bundle
+ SetApptype(app_bundle)
end
else
IllegalPara(opt);
@@ -1766,9 +1766,9 @@ begin
if target_info.system in systems_all_windows+systems_os2+systems_macos then
begin
if UnsetBool(More, j, opt, false) then
- apptype:=app_gui
+ SetApptype(app_gui)
else
- apptype:=app_cui;
+ SetApptype(app_cui);
end
else
IllegalPara(opt);
@@ -1799,9 +1799,9 @@ begin
if target_info.system in systems_os2 then
begin
if UnsetBool(More, j, opt, false) then
- apptype:=app_cui
+ SetApptype(app_cui)
else
- apptype:=app_fs;
+ SetApptype(app_fs);
end
else
IllegalPara(opt);
@@ -1811,9 +1811,9 @@ begin
if target_info.system in systems_all_windows+systems_os2+systems_macos then
begin
if UnsetBool(More, j, opt, false) then
- apptype:=app_cui
+ SetApptype(app_cui)
else
- apptype:=app_gui;
+ SetApptype(app_gui);
end
else
IllegalPara(opt);
@@ -1899,9 +1899,9 @@ begin
if target_info.system in systems_macos then
begin
if UnsetBool(More, j, opt, false) then
- apptype:=app_cui
+ SetApptype(app_cui)
else
- apptype:=app_tool;
+ SetApptype(app_tool);
end
else
IllegalPara(opt);
@@ -2766,7 +2766,9 @@ begin
{ target is set here, for wince the default app type is gui }
if target_info.system in systems_wince then
- apptype:=app_gui;
+ SetApptype(app_gui)
+ else
+ SetApptype(apptype);
{ default defines }
def_system_macro(target_info.shortname);
diff --git a/compiler/scandir.pas b/compiler/scandir.pas
index 5f5ef3dfef..68a87ea562 100644
--- a/compiler/scandir.pas
+++ b/compiler/scandir.pas
@@ -252,20 +252,20 @@ unit scandir;
current_scanner.skipspace;
hs:=current_scanner.readid;
if hs='GUI' then
- apptype:=app_gui
+ SetApptype(app_gui)
else if hs='CONSOLE' then
- apptype:=app_cui
+ SetApptype(app_cui)
else if (hs='NATIVE') and (target_info.system in systems_windows + systems_nativent) then
- apptype:=app_native
+ SetApptype(app_native)
else if (hs='FS') and (target_info.system in [system_i386_os2,
system_i386_emx]) then
- apptype:=app_fs
+ SetApptype(app_fs)
else if (hs='TOOL') and (target_info.system in [system_powerpc_macos]) then
- apptype:=app_tool
+ SetApptype(app_tool)
else if (hs='ARM9') and (target_info.system in [system_arm_nds]) then
- apptype:=app_arm9
+ SetApptype(app_arm9)
else if (hs='ARM7') and (target_info.system in [system_arm_nds]) then
- apptype:=app_arm7
+ SetApptype(app_arm7)
else
Message1(scan_w_unsupported_app_type,hs);
end;
diff --git a/compiler/scanner.pas b/compiler/scanner.pas
index ed6eb033fe..56d5aea5d6 100644
--- a/compiler/scanner.pas
+++ b/compiler/scanner.pas
@@ -261,6 +261,7 @@ interface
{ To be called when the language mode is finally determined }
Function SetCompileMode(const s:string; changeInit: boolean):boolean;
Function SetCompileModeSwitch(s:string; changeInit: boolean):boolean;
+ procedure SetAppType(NewAppType:tapptype);
implementation
@@ -624,6 +625,14 @@ implementation
end;
end;
+ procedure SetAppType(NewAppType:tapptype);
+ begin
+ if apptype=app_cui then
+ undef_system_macro('CONSOLE');
+ apptype:=NewAppType;
+ if apptype=app_cui then
+ def_system_macro('CONSOLE');
+ end;
{*****************************************************************************
Conditional Directives
*****************************************************************************}
diff --git a/compiler/systems/t_nds.pas b/compiler/systems/t_nds.pas
index dcf18ab20e..7b7ab351de 100644
--- a/compiler/systems/t_nds.pas
+++ b/compiler/systems/t_nds.pas
@@ -58,7 +58,7 @@ begin
StaticLibFiles.doubles:=true;
// set arm9 as default apptype
if (apptype <> app_arm9) or (apptype <> app_arm7) then
- apptype := app_arm9;
+ apptype:=app_arm9;
end;