Inconsistent definition of _OCC64 on Linux/AMD64

Greetings,

After compiling OCC on Linux/AMD64 (specifically, Debian unstable using my packages), UndefinedHandleAddress is defined as its 64-bit version in the libraries. Unfortunately, Standard_Macro.hxx does not define it while compiling a new binary, so there is an inconsistent UndefinedHandleAddress due presumably to the inconsistent definition of _OCC64.

This results in a crash for FreeCAD. Details at: https://sourceforge.net/forum/forum.php?thread_id=2059818&forum_id=161658

The _OCC64 macro should really be defined in config.h by configure using a sizeof(long) or sizeof(void *) test.

Until this is resolved upstream, I think the best workaround is to disable the 64-bit version of UndefinedHandleAddress. I'm planning to do this for the Debian packages, unless someone offers a better idea...

Adam Powell's picture

Denis Barbier wrote a patch to fix this problem, so _OCC64 is defined in Standard_Macro.hxx (by the configure script if appropriate). I added a couple of bits to make sure UndefinedHandleAddress is defined consistently throughout the libs. Now external apps do not need to set this, just #include

The patch is at http://lyre.mit.edu/~powell/opencascade/OCC64.patch

NOTE: it conflicts with Jason Kraftcheck's occ6.2.patch -- you need to delete the first bit of his patch in order to use them together.