diff --git a/compiler/globtype.pas b/compiler/globtype.pas index 899f745640..f98eba2593 100644 --- a/compiler/globtype.pas +++ b/compiler/globtype.pas @@ -103,7 +103,11 @@ interface pointer(-1) will result in a pointer with the value $fffffffffffffff on a 32bit machine if the compiler uses int64 constants internally (JM) } +{$ifdef i8086} + TConstPtrUInt = LongWord; { 32-bit for far pointers support } +{$else i8086} TConstPtrUInt = AWord; +{$endif i8086} { Use a variant record to be sure that the array if aligned correctly } tdoublerec=record diff --git a/compiler/ncon.pas b/compiler/ncon.pas index 22a9cd8e47..daf68e2866 100644 --- a/compiler/ncon.pas +++ b/compiler/ncon.pas @@ -724,6 +724,11 @@ implementation begin inherited create(pointerconstn); +{$ifdef i8086} + { truncate near pointers } + if (def.typ<>pointerdef) or not (tpointerdef(def).x86pointertyp in [x86pt_far,x86pt_huge]) then + v := Word(v); +{$endif i8086} value:=v; typedef:=def; end;