2
0
Эх сурвалжийг харах

* fix error on win64 and concerns about pulling math into the windows unit by a local arctan2 copy

(cherry picked from commit 7bd56139540c86c521e66be74469749a2dc62b89)
florian 2 жил өмнө
parent
commit
92fe577846

+ 23 - 0
rtl/inc/typshrd.inc

@@ -142,6 +142,29 @@ begin
 end;
 
 function TPoint.Angle(const pt: TPoint): Single;
+
+  function arctan2(y,x : Single) : Single;
+    begin
+      if x=0 then
+        begin
+          if y=0 then
+            result:=0.0
+          else if y>0 then
+            result:=pi/2
+          else
+            result:=-pi/2;
+        end
+      else
+        begin
+          result:=ArcTan(y/x);
+          if x<0 then
+            if y<0 then
+              result:=result-pi
+            else
+              result:=result+pi;
+        end;
+    end;
+
 begin
   result:=ArcTan2(y-pt.y,x-pt.x);
 end;

+ 0 - 2
rtl/win32/windows.pp

@@ -53,8 +53,6 @@ interface
 
 implementation
 
-uses math;
-
 {$undef read_interface}
 {$define read_implementation}