Browse Source

+ default_x86_data_pointer_type implemented as function that returns the proper
type in far data memory models

git-svn-id: trunk@26928 -

nickysn 11 years ago
parent
commit
75134c2a26
1 changed files with 16 additions and 7 deletions
  1. 16 7
      compiler/symdef.pas

+ 16 - 7
compiler/symdef.pas

@@ -196,13 +196,6 @@ interface
           procedure deref;override;
        end;
 
-{$ifdef x86}
-    const
-       { TODO: make this depend on the memory model, when other memory models are supported }
-       default_x86_data_pointer_type = x86pt_near;
-
-    type
-{$endif x86}
 
        { tpointerdef }
 
@@ -1115,6 +1108,10 @@ interface
     function getansistringdef:tstringdef;
     function getparaencoding(def:tdef):tstringencoding; inline;
 
+{$ifdef x86}
+    function default_x86_data_pointer_type: tx86pointertyp;
+{$endif x86}
+
 implementation
 
     uses
@@ -7491,4 +7488,16 @@ implementation
       end;
 
 
+{$ifdef x86}
+    function default_x86_data_pointer_type: tx86pointertyp;
+      begin
+{$ifdef i8086}
+        if current_settings.x86memorymodel in x86_far_data_models then
+          result:=x86pt_far
+        else
+{$endif i8086}
+          result:=x86pt_near;
+      end;
+{$endif x86}
+
 end.