aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib/JEDI-SDL/OpenGL-Set8087CW.patch
blob: aeebeee513e5fe7f6c2e6751d9b8b52e8286d257 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Index: OpenGL/Pas/gl.pas
===================================================================
--- OpenGL/Pas/gl.pas	(revision 961)
+++ OpenGL/Pas/gl.pas	(working copy)
@@ -2287,9 +2287,9 @@
 end;
 
 initialization
-  {$ifdef x86}
+  {$IF Defined(CPU386) or Defined(CPUI386) or Defined(CPUX86_64)}
   Set8087CW($133F);
-  {$endif x86}
+  {$IFEND}
 
   LoadOpenGL( GLLibName );
 
Index: OpenGL/Pas/opengl12.pas
===================================================================
--- OpenGL/Pas/opengl12.pas	(revision 961)
+++ OpenGL/Pas/opengl12.pas	(working copy)
@@ -7125,16 +7125,15 @@
 
 //----------------------------------------------------------------------------------------------------------------------
 
-{$ifndef VER140}
+// RaiseLastOSError did not exist in Delphi 5
+{$ifdef VER130}
 
 procedure RaiseLastOSError;
 begin
-  {$ifndef FPC}
   RaiseLastWin32Error;
-  {$endif}
 end;
 
-{$endif VER140}
+{$endif}
 
 //----------------------------------------------------------------------------------------------------------------------
 
@@ -9948,21 +9947,16 @@
 end; 
 
 //----------------------------------------------------------------------------------------------------------------------
-{$ifdef FPC}
-const Default8087CW: Word = $1332;
 
-{$ASMMODE INTEL}
-procedure Set8087CW(NewCW: Word); Assembler;
-asm
-  MOV Default8087CW, AX
-end;
-{$endif}
-
-//----------------------------------------------------------------------------------------------------------------------
-
 initialization
-  ContextList := TThreadList.Create; 
-  Set8087CW($133F); 
+  ContextList := TThreadList.Create;
+  {$IF Defined(CPU386) or Defined(CPUI386) or Defined(CPUX86_64)}
+  // FPC has its own implementation of Set8087CW now. The wrongly
+  // coded (the important asm-directives were missing so it was not of any use!!!)
+  // implementation was removed from this unit so it does not hide the correct FPC version anymore.
+  // This should fix some EDivByZero exceptions in floating-point expressions.
+  Set8087CW($133F);
+  {$IFEND}
 finalization
   CloseOpenGL; 
   ContextList.Free;