ソースを参照

+ allow {$apptype com} and {$apptype exe} to set the msdos binary format
+ added extra check to ensure that {$apptype console} and {$apptype gui} produce a warning and do not change the binary format to .exe on msdos

git-svn-id: trunk@25547 -

nickysn 12 年 前
コミット
2afea8fc19
1 ファイル変更8 行追加3 行削除
  1. 8 3
      compiler/scandir.pas

+ 8 - 3
compiler/scandir.pas

@@ -237,7 +237,8 @@ unit scandir;
       begin
         if not (target_info.system in systems_all_windows + [system_i386_os2,
                                        system_i386_emx, system_powerpc_macos,
-                                       system_arm_nds] + systems_nativent) then
+                                       system_arm_nds, system_i8086_msdos] +
+                                       systems_nativent) then
           begin
             if m_delphi in current_settings.modeswitches then
               Message(scan_n_app_type_not_support)
@@ -252,9 +253,9 @@ unit scandir;
               begin
                  current_scanner.skipspace;
                  hs:=current_scanner.readid;
-                 if hs='GUI' then
+                 if (hs='GUI') and not (target_info.system in [system_i8086_msdos]) then
                    SetApptype(app_gui)
-                 else if hs='CONSOLE' then
+                 else if (hs='CONSOLE') and not (target_info.system in [system_i8086_msdos]) then
                    SetApptype(app_cui)
                  else if (hs='NATIVE') and (target_info.system in systems_windows + systems_nativent) then
                    SetApptype(app_native)
@@ -267,6 +268,10 @@ unit scandir;
                    SetApptype(app_arm9)
                  else if (hs='ARM7') and (target_info.system in [system_arm_nds]) then
                    SetApptype(app_arm7)
+                 else if (hs='COM') and (target_info.system in [system_i8086_msdos]) then
+                   SetApptype(app_com)
+                 else if (hs='EXE') and (target_info.system in [system_i8086_msdos]) then
+                   SetApptype(app_cui)
                  else
                    Message1(scan_w_unsupported_app_type,hs);
               end;