浏览代码

* Fixed r44145. To test if a constant is declared it is needed to use {$if declared()} instead of {$if defined()}.

git-svn-id: trunk@48389 -
yury 4 年之前
父节点
当前提交
31cd3df783
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      compiler/rgobj.pas

+ 1 - 3
compiler/rgobj.pas

@@ -1720,11 +1720,9 @@ unit rgobj;
           {        while compiling the compiler. }
           {        while compiling the compiler. }
           tmpr:=NR_STACK_POINTER_REG;
           tmpr:=NR_STACK_POINTER_REG;
           { e.g. AVR does not have a stack pointer register }
           { e.g. AVR does not have a stack pointer register }
-{$if defined(RS_STACK_POINTER_REG)}
-  {$if (RS_STACK_POINTER_REG<>RS_INVALID)}
+{$if declared(RS_STACK_POINTER_REG) and (RS_STACK_POINTER_REG<>RS_INVALID)}
           if (regtype=getregtype(tmpr)) then
           if (regtype=getregtype(tmpr)) then
             include(adj_colours,RS_STACK_POINTER_REG);
             include(adj_colours,RS_STACK_POINTER_REG);
-  {$ifend}
 {$ifend}
 {$ifend}
           {Assume a spill by default...}
           {Assume a spill by default...}
           found:=false;
           found:=false;