]> gerrit.simantics Code Review - simantics/3d.git/blob - org.jcae.opencascade/occ-mingw-port.patch
Remove deprecated/duplicate version of org.simantics.objmap2
[simantics/3d.git] / org.jcae.opencascade / occ-mingw-port.patch
1 diff --git a/ros/inc/Handle_Standard_Transient.hxx b/ros/inc/Handle_Standard_Transient.hxx
2 index 0500103..e3c6202 100644
3 --- a/ros/inc/Handle_Standard_Transient.hxx
4 +++ b/ros/inc/Handle_Standard_Transient.hxx
5 @@ -13,7 +13,7 @@
6  #include <Standard_Transient_proto.hxx>
7  #endif
8  
9 -#ifdef _WIN32
10 +#ifdef _MSC_VER
11  // Disable the warning "conversion from 'unsigned int' to Standard_Transient *"
12  #pragma warning (push)
13  #pragma warning (disable:4312)
14 @@ -228,7 +228,7 @@ private:
15    Standard_Transient *entity;
16  };
17  
18 -#ifdef _WIN32
19 +#ifdef _MSC_VER
20  #pragma warning (pop)
21  #endif
22  
23 diff --git a/ros/inc/Standard_Atomic.hxx b/ros/inc/Standard_Atomic.hxx
24 index 4842877..73adc8b 100644
25 --- a/ros/inc/Standard_Atomic.hxx
26 +++ b/ros/inc/Standard_Atomic.hxx
27 @@ -24,7 +24,7 @@
28  //===================================================
29  // Windows NT, MSVC++ compiler
30  //===================================================
31 -#if defined(WNT)
32 +#if defined(_MSC_VER)
33  
34  extern "C" {
35  long _InterlockedIncrement(long volatile* lpAddend);
36 diff --git a/ros/inc/Standard_CString.hxx b/ros/inc/Standard_CString.hxx
37 index a1caadf..f003f8c 100644
38 --- a/ros/inc/Standard_CString.hxx
39 +++ b/ros/inc/Standard_CString.hxx
40 @@ -13,7 +13,7 @@
41  #  include <Standard_TypeDef.hxx>
42  # endif
43  
44 -# ifdef WNT
45 +# ifdef _MSC_VER
46  #  define strcasecmp _stricmp
47  # endif
48  
49 diff --git a/ros/inc/Standard_Macro.hxx b/ros/inc/Standard_Macro.hxx
50 index 0df32b7..852d8c2 100644
51 --- a/ros/inc/Standard_Macro.hxx
52 +++ b/ros/inc/Standard_Macro.hxx
53 @@ -125,7 +125,4 @@
54  //#  endif  // WNT
55  # endif  // __Standard_API
56  
57 -// Define _OCC64 variable (unless already defined) if platform is known to be 64-bit
58 -#include <arch-6.5.0/Standard_Macro64.hxx>
59 -
60  #endif  
61 diff --git a/ros/inc/Standard_values.h b/ros/inc/Standard_values.h
62 index 623800a..bc78d2e 100644
63 --- a/ros/inc/Standard_values.h
64 +++ b/ros/inc/Standard_values.h
65 @@ -31,6 +31,10 @@ Facility : CAS-CADE V1.3A
66  # include <limits>
67  #endif
68  
69 +#ifdef __MINGW32__
70 +# include <limits.h>
71 +#endif
72 +
73  #if defined (__hpux) || defined (HPUX)
74  # ifdef MAXINT
75  #  undef MAXINT
76 diff --git a/ros/src/MFT/MFT_FontManager.cxx b/ros/src/MFT/MFT_FontManager.cxx
77 index 5820d62..238c58c 100644
78 --- a/ros/src/MFT/MFT_FontManager.cxx
79 +++ b/ros/src/MFT/MFT_FontManager.cxx
80 @@ -148,6 +148,9 @@
81  //        -- Category: Local structures 
82  //        --------------------------------
83  
84 +#ifdef __MINGW32__
85 +       #define DrawTextA DrawText
86 +#endif
87  
88  #define MFT_COMMANDBUFFERSIZE 512
89  typedef struct _MFT_CommandBuffer {
90 diff --git a/ros/src/OSD/OSD.cxx b/ros/src/OSD/OSD.cxx
91 index 58e75b1..e1b133a 100644
92 --- a/ros/src/OSD/OSD.cxx
93 +++ b/ros/src/OSD/OSD.cxx
94 @@ -99,7 +99,7 @@ Standard_Boolean OSD::CStringToReal(const Standard_CString aString,
95  //=======================================================================
96  
97  #ifdef WNT
98 -# include <Windows.h>
99 +# include <windows.h>
100  #if !defined(__CYGWIN32__) && !defined(__MINGW32__)
101  # include <Mapiwin.h>
102  #endif
103 diff --git a/ros/src/OSD/OSD_Process.cxx b/ros/src/OSD/OSD_Process.cxx
104 index 8b01231..6eeb9b3 100644
105 --- a/ros/src/OSD/OSD_Process.cxx
106 +++ b/ros/src/OSD/OSD_Process.cxx
107 @@ -202,7 +202,7 @@ Standard_Integer OSD_Process::Error()const{
108  #include <Quantity_Date.hxx>
109  
110  #include <OSD_WNT_1.hxx>
111 -#include <LMCONS.H> /// pour UNLEN  ( see MSDN about GetUserName() )
112 +#include <lmcons.h> /// pour UNLEN  ( see MSDN about GetUserName() )
113  
114  
115  #pragma warning( disable : 4700 )
116 diff --git a/ros/src/OSD/OSD_signal_WNT.cxx b/ros/src/OSD/OSD_signal_WNT.cxx
117 index 89a67a1..a21df90 100644
118 --- a/ros/src/OSD/OSD_signal_WNT.cxx
119 +++ b/ros/src/OSD/OSD_signal_WNT.cxx
120 @@ -550,8 +550,10 @@ static LONG __fastcall _osd_raise ( DWORD dwCode, LPTSTR msg )
121    case EXCEPTION_FLT_INVALID_OPERATION:
122    case EXCEPTION_FLT_DENORMAL_OPERAND:
123    case EXCEPTION_FLT_INEXACT_RESULT:
124 +#ifdef _MSC_VER
125    case STATUS_FLOAT_MULTIPLE_TRAPS:
126    case STATUS_FLOAT_MULTIPLE_FAULTS:
127 +#endif
128         Standard_NumericError :: Raise ( msg );
129    default:
130      break;
131 diff --git a/ros/src/Standard/Standard_MMgrOpt.cxx b/ros/src/Standard/Standard_MMgrOpt.cxx
132 index c170bbd..0be6e25 100644
133 --- a/ros/src/Standard/Standard_MMgrOpt.cxx
134 +++ b/ros/src/Standard/Standard_MMgrOpt.cxx
135 @@ -846,7 +846,7 @@ void Standard_MMgrOpt::FreeMemory (Standard_Address aBlock,
136      // recover handle to the memory mapping stored just before the block
137      const HANDLE * aMBlock = (const HANDLE *)aBlock;
138      HANDLE hMap = *(--aMBlock);
139 -    UnmapViewOfFile((LPCVOID)aMBlock);
140 +       UnmapViewOfFile(const_cast<void*>((LPCVOID)aMBlock));
141      CloseHandle (hMap);
142  #endif
143    }
144 diff --git a/ros/src/WNT/EHDC.cxx b/ros/src/WNT/EHDC.cxx
145 index 75dd8f2..a184cec 100644
146 --- a/ros/src/WNT/EHDC.cxx
147 +++ b/ros/src/WNT/EHDC.cxx
148 @@ -8,6 +8,11 @@
149  
150  #include <math.h>
151  #include <limits>
152 +#ifdef __MINGW32__
153 +       #include <stdlib.h>
154 +       #include <limits.h>
155 +       #define min(a,b) ((a)<(b)?(a):(b))
156 +#endif
157  
158  #define ROUNDL( d ) ( LONG )(  ( d ) + 0.5  )
159  #define Y( y )      (  mySize.cy - ( y )  )
160 @@ -33,6 +38,8 @@ static void WINAPI _XFORMApplyf  ( PFPOINT, int, PXFORM    );
161  static void WINAPI _RenderPath ( HDC, LPPOINT, PBYTE, int );
162  static int  WINAPI _TextPath   ( HDC, int, int, void*, LPPOINT, PBYTE, int, PSIZE, BOOL );
163  
164 +VOID CALLBACK ___auxDDAF ( int x, int y, LPARAM lpParam );
165
166  EHDC :: EHDC ( HDC hdc, PSIZE szClient ) {
167  
168   _Init ();
169 diff --git a/ros/src/WNT/W32_Allocator.hxx b/ros/src/WNT/W32_Allocator.hxx
170 index abdf9eb..33dadcb 100644
171 --- a/ros/src/WNT/W32_Allocator.hxx
172 +++ b/ros/src/WNT/W32_Allocator.hxx
173 @@ -101,7 +101,6 @@ struct W32_Note {  // base class to represent graphic object
174  
175  #ifdef OCC5415
176   void operator delete (void*, W32_Allocator*) {}
177 -private: // to protect against possible accidental usage
178   void operator delete (void* p) {}
179  #endif
180  };
181 diff --git a/ros/src/WNT/W95_Allocator.cxx b/ros/src/WNT/W95_Allocator.cxx
182 index d1501e1..855c7dc 100644
183 --- a/ros/src/WNT/W95_Allocator.cxx
184 +++ b/ros/src/WNT/W95_Allocator.cxx
185 @@ -13,6 +13,13 @@
186  #include <math.h>
187  #include <limits>
188  
189 +#ifdef __MINGW32__
190 +       #include <stdlib.h>
191 +       #include <limits.h>
192 +       #define min(a,b) ((a)<(b)?(a):(b))
193 +       #define max(a,b) ((a)>(b)?(a):(b))
194 +#endif
195 +
196  #define SGN( x )  (   ( x ) > 0 ? 1 : (  ( x ) < 0 ? -1 : 0 )   )
197  #define ALLOCATOR (   ( PW95_Allocator )myAllocator             )
198  
199 diff --git a/ros/src/WNT/WNT_Allocator.cxx b/ros/src/WNT/WNT_Allocator.cxx
200 index 0f7b898..eeedb54 100644
201 --- a/ros/src/WNT/WNT_Allocator.cxx
202 +++ b/ros/src/WNT/WNT_Allocator.cxx
203 @@ -16,6 +16,7 @@
204  #include <stdio.h>
205  
206  #define ALLOCATOR ( ( PWNT_Allocator )myAllocator )
207 +#define max(a,b) ((a)>(b)?(a):(b))
208  
209  static XFORM xfmIdent = { ( FLOAT )0.8660,  ( FLOAT )0.5000,
210                            ( FLOAT )-0.5000, ( FLOAT )0.8660,
211 diff --git a/ros/src/WNT/WNT_DDriver.cxx b/ros/src/WNT/WNT_DDriver.cxx
212 index 9c98336..4099c9c 100644
213 --- a/ros/src/WNT/WNT_DDriver.cxx
214 +++ b/ros/src/WNT/WNT_DDriver.cxx
215 @@ -102,7 +102,7 @@ static void __fastcall         _dd_fill_buff ( char* );
216  static int  __fastcall         _dd_dev_size  ( HDC, int );
217  
218  static int CALLBACK _dd_enum_proc (
219 -                     HDC, HANDLETABLE FAR*, CONST ENHMETARECORD FAR*,
220 +                     HDC, HANDLETABLE FAR*, ENHMETARECORD FAR*,
221                       int, LPARAM
222                      );
223  
224 @@ -1983,7 +1983,7 @@ static int __fastcall _dd_dev_size ( HDC hdc, int index ) {
225  static int CALLBACK _dd_enum_proc (
226                       HDC                         hDC,
227                       HANDLETABLE FAR*       lpHTable,
228 -                     CONST ENHMETARECORD FAR* lpEMFR,
229 +                     ENHMETARECORD FAR* lpEMFR,
230                       int                        nObj,
231                       LPARAM                   lpData
232                      ) {
233 diff --git a/ros/src/WNT/WNT_IconBox.cxx b/ros/src/WNT/WNT_IconBox.cxx
234 index d5565a3..f80699f 100644
235 --- a/ros/src/WNT/WNT_IconBox.cxx
236 +++ b/ros/src/WNT/WNT_IconBox.cxx
237 @@ -30,7 +30,7 @@ WNT_IconBox :: WNT_IconBox (
238                 ) : WNT_Window (
239                      aDevice, aName,
240                      new WNT_WClass (
241 -                         "WNT_IconBoxClass", WNT_IconBoxWndProc,
242 +                         "WNT_IconBoxClass", (void*)WNT_IconBoxWndProc,
243                           CS_HREDRAW | CS_VREDRAW
244                          ),
245                      aStyle | WS_VSCROLL,
246 @@ -322,8 +322,10 @@ Standard_Boolean WNT_IconBox :: IconSize (
247  
248   }  // end for
249  
250 - return ( i > len ) ? Standard_False :
251 -                      myImages -> Dim ( i, Width, Height ), Standard_True;
252 + bool b = i <= len;
253 + if(b)
254 +    myImages -> Dim ( i, Width, Height );
255 + return b;
256  
257  }  // end WNT_IconBox :: IconSize
258  //***//
259 diff --git a/ros/src/WNT/WNT_ImageProcessor.cxx b/ros/src/WNT/WNT_ImageProcessor.cxx
260 index 7809c05..7782e72 100644
261 --- a/ros/src/WNT/WNT_ImageProcessor.cxx
262 +++ b/ros/src/WNT/WNT_ImageProcessor.cxx
263 @@ -49,6 +49,10 @@
264  #endif  /* _DEBUG */
265  #define WINNT35X() (WNT_osVer.dwPlatformId   == VER_PLATFORM_WIN32_NT && \
266                      WNT_osVer.dwMajorVersion == 3 )
267 +#ifdef __MINGW32__
268 +       #define __leave return Standard_False;
269 +       #define __finally catch(...)
270 +#endif
271  //***//
272  typedef struct {
273  
274 diff --git a/ros/src/WNT/WNT_WClass.cxx b/ros/src/WNT/WNT_WClass.cxx
275 index c2f1d87..44e64ff 100644
276 --- a/ros/src/WNT/WNT_WClass.cxx
277 +++ b/ros/src/WNT/WNT_WClass.cxx
278 @@ -47,7 +47,7 @@ WNT_WClass::WNT_WClass (
279  
280    lpszName = new char[ strlen ( aClassName ) + 1 ];
281    strcpy ( (Standard_PCharacter)lpszName, aClassName );
282 -  lpfnWndProc = wc.lpfnWndProc;
283 +  lpfnWndProc = (void*)wc.lpfnWndProc;
284  
285  }  // end constructor
286  
287 diff --git a/ros/src/WNT/WNT_Window.cxx b/ros/src/WNT/WNT_Window.cxx
288 index a4bfca0..f1f71ab 100644
289 --- a/ros/src/WNT/WNT_Window.cxx
290 +++ b/ros/src/WNT/WNT_Window.cxx
291 @@ -514,10 +514,10 @@ Aspect_TypeOfResize WNT_Window :: DoResize () const {
292  
293   if ( wp.showCmd != SW_SHOWMINIMIZED ) {
294  
295 -  if (  Abs ( wp.rcNormalPosition.left   - aXLeft   ) > 2  ) mask |= 1;
296 -  if (  Abs ( wp.rcNormalPosition.right  - aXRight  ) > 2  ) mask |= 2;
297 -  if (  Abs ( wp.rcNormalPosition.top    - aYTop    ) > 2  ) mask |= 4;
298 -  if (  Abs ( wp.rcNormalPosition.bottom - aYBottom ) > 2  ) mask |= 8;
299 +  if (  Abs ( (Standard_Integer) (wp.rcNormalPosition.left   - aXLeft)   ) > 2  ) mask |= 1;
300 +  if (  Abs ( (Standard_Integer) (wp.rcNormalPosition.right  - aXRight ) ) > 2  ) mask |= 2;
301 +  if (  Abs ( (Standard_Integer) (wp.rcNormalPosition.top    - aYTop   ) ) > 2  ) mask |= 4;
302 +  if (  Abs ( (Standard_Integer) (wp.rcNormalPosition.bottom - aYBottom) ) > 2  ) mask |= 8;
303  
304    switch ( mask ) {
305  
306 @@ -1207,7 +1207,7 @@ void WNT_Window :: doCreate (
307  
308   if ( wProc != &WNT_WndProc ) {
309  
310 -  myWndProc = wProc;
311 +  myWndProc = (void*)wProc;
312  
313    SetBackground ( aBackColor );
314