+ added directive {$HUGEPOINTERARITHMETICNORMALIZATION} to control the

cs_hugeptr_arithmetic_normalization local setting
+ added the cs_hugeptr_comparison_normalization local setting and corresponding
  directive {$HUGEPOINTERCOMPARISONNORMALIZATION} to set it
* the {HUGEPOINTERNORMALIZATION} changed to set both of the huge pointer
  normalization settings, according to the specified compiler type ('BORLANDC',
  'MICROSOFTC' or 'WATCOMC')

git-svn-id: trunk@28151 -
This commit is contained in:
nickysn 2014-07-04 14:43:46 +00:00
parent a3b48b79cb
commit 63305cc2e6
2 changed files with 44 additions and 1 deletions

View File

@ -146,7 +146,8 @@ interface
cs_zerobasedstrings,
{ i8086 specific }
cs_force_far_calls,
cs_hugeptr_arithmetic_normalization
cs_hugeptr_arithmetic_normalization,
cs_hugeptr_comparison_normalization
);
tlocalswitches = set of tlocalswitch;

View File

@ -1573,15 +1573,55 @@ unit scandir;
end;
procedure dir_hugepointernormalization;
var
hs : string;
begin
if target_info.system<>system_i8086_msdos then
begin
Message1(scanner_w_directive_ignored_on_target, 'HUGEPOINTERNORMALIZATION');
exit;
end;
current_scanner.skipspace;
hs:=current_scanner.readid;
case hs of
'BORLANDC':
begin
recordpendinglocalswitch(cs_hugeptr_arithmetic_normalization,'+');
recordpendinglocalswitch(cs_hugeptr_comparison_normalization,'+');
end;
'MICROSOFTC':
begin
recordpendinglocalswitch(cs_hugeptr_arithmetic_normalization,'-');
recordpendinglocalswitch(cs_hugeptr_comparison_normalization,'-');
end;
'WATCOMC':
begin
recordpendinglocalswitch(cs_hugeptr_arithmetic_normalization,'-');
recordpendinglocalswitch(cs_hugeptr_comparison_normalization,'+');
end;
end;
end;
procedure dir_hugepointerarithmeticnormalization;
begin
if target_info.system<>system_i8086_msdos then
begin
Message1(scanner_w_directive_ignored_on_target, 'HUGEPOINTERARITHMETICNORMALIZATION');
exit;
end;
do_localswitch(cs_hugeptr_arithmetic_normalization);
end;
procedure dir_hugepointercomparisonnormalization;
begin
if target_info.system<>system_i8086_msdos then
begin
Message1(scanner_w_directive_ignored_on_target, 'HUGEPOINTERCOMPARISONNORMALIZATION');
exit;
end;
do_localswitch(cs_hugeptr_comparison_normalization);
end;
procedure dir_weakpackageunit;
begin
end;
@ -1686,6 +1726,8 @@ unit scandir;
AddDirective('HPPEMIT',directive_all, @dir_hppemit);
AddDirective('HUGECODE',directive_all, @dir_hugecode);
AddDirective('HUGEPOINTERNORMALIZATION',directive_all,@dir_hugepointernormalization);
AddDirective('HUGEPOINTERARITHMETICNORMALIZATION',directive_all,@dir_hugepointerarithmeticnormalization);
AddDirective('HUGEPOINTERCOMPARISONNORMALIZATION',directive_all,@dir_hugepointercomparisonnormalization);
AddDirective('IEEEERRORS',directive_all,@dir_ieeeerrors);
AddDirective('IOCHECKS',directive_all, @dir_iochecks);
AddDirective('IMAGEBASE',directive_all, @dir_imagebase);