In previous post Commenter-1 make some patch under AdvApp2Var_MathBase. It's tested and working for 100%%.
In my case I have easy convert like:
int x = *((int*)(&arg)); and It's working under GCC 4 or higher
Also files needs to be patched:
in inc folder, without Roman's patched files:
in sources, without Roman's patched files:
MFT_FontManager.cxx
NCollection_IncAllocator.cxx (on the forum has patched too)
OpenGl_polygon.cxx
OpenGl_polygonholes.cxx
OpenGl_subrvis.cxx
OpenGl_txgl.cxx
OSD_DirectoryIterator.cxx
OSD_EnvironmentIterator.cxx
OSD_File.cxx
OSD_FileIterator.cxx
OSD_FileNode.cxx
OSD_Process.cxx
OSD_SharedMemory.cxx
OSD_signal_WNT.cxx
OSD_Thread.cxx
OSD_WNT.cxx
OSD_WNT_1.cxx
Visual3d_View.cxx
Visual3d_ViewManager.cxx
WNT_DDriver.cxx
WNT_GraphicDevice.cxx
WNT_MFTDraw.cxx
WNT_TextManager.cxx
WNT_WDriver.cxx
WNT_Window.cxx
In all of this files we have dangerous conversion on 32 / 64 bit types. I don't use cast method because it's not safe too (I think so) if patch with *((int*)(&arg)) conversion is needed I can upload this here.
Could you please post your patch here for review ? I cannot easily see what needs changing in OSD_DirectoryIterator, for instance.
Indeed, there are many more warnings when building an app in 64 bit, so it's definitively worth for OCC team addressing them. The bad news is that current code hides potential issues with casts which are valid in 32bit mode but can become wrong in 64:
long l = (long)(&var);
...
MyVar* p = (var*)(l);
The code will compile with no warnings and hides an error.
Commenter-1
P.S. I used to prefer C++-style casts (static_cast, reinterpret_cast, ...) to C-style ( (MyVar)) as they are more explicit and strict.
02Author
Hi, in I really know some cast method in asm code. It's a hack method. Really if we convert with *(int*)arg the compiler hide warning, but when we try the result the app is broken. I make tests for last week and my patches work fine like your patch. Give me some time for generate diff files.
03Author
I don't create the diff files because there is more differences with original sources. I'm write into txt all changes that I make to work OCC librarys on 64 bit Windows. Many thanks you if you create the patch for OCC sources originally.
Best regards,
Yuriy
04Author
And don't forget replace WIN64 definitions with _WIN64.
05Author
Roman, what are you think about memsize types ? It's a really may take some effect on 64 bit Win/Linux platform ???