Explorar o código

Check memory model for i8086-win16 system use large memory model by default

Pierre Muller hai 1 mes
pai
achega
f3311d9576
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      compiler/options.pas

+ 13 - 0
compiler/options.pas

@@ -60,6 +60,7 @@ Type
     parasubtarget    : string;
     parasubtarget    : string;
     LinkTypeSetExplicitly : boolean;
     LinkTypeSetExplicitly : boolean;
     LinkerSetExplicitly : boolean;
     LinkerSetExplicitly : boolean;
+    MemoryModelSetExplicitly : boolean;
     Constructor Create;
     Constructor Create;
     Destructor Destroy;override;
     Destructor Destroy;override;
     procedure WriteLogo;
     procedure WriteLogo;
@@ -2253,6 +2254,16 @@ begin
       Message(option_com_files_require_tiny_model);
       Message(option_com_files_require_tiny_model);
       StopOptions(1);
       StopOptions(1);
     end;
     end;
+  if (target_info.system = system_i8086_win16) and
+     not (init_settings.x86memorymodel in [mm_large,mm_huge]) then
+    begin
+      if MemoryModelSetExplicitly then
+        Message1(option_e_win16_unsupported_memory_model,x86memorymodelstr[init_settings.x86memorymodel])
+      else
+        Message(option_n_win16_set_default_large_memory_model);
+      undef_system_macro('FPC_MM_'+x86memorymodelstr[init_settings.x86memorymodel]);
+      init_settings.x86memorymodel:=mm_large;
+    end;
 {$endif i8086}
 {$endif i8086}
 
 
 {$ifndef i8086_link_intern_debuginfo}
 {$ifndef i8086_link_intern_debuginfo}
@@ -2337,6 +2348,7 @@ begin
   paratargetdbg:=dbg_none;
   paratargetdbg:=dbg_none;
   LinkTypeSetExplicitly:=false;
   LinkTypeSetExplicitly:=false;
   LinkerSetExplicitly:=false;
   LinkerSetExplicitly:=false;
+  MemoryModelSetExplicitly:=false;
 end;
 end;
 
 
 
 
@@ -4035,6 +4047,7 @@ begin
                  else
                  else
                    IllegalPara(opt);
                    IllegalPara(opt);
                end;
                end;
+               MemoryModelSetExplicitly:=true;
                break;
                break;
              end
              end
            else
            else