Move _OCC64 macro definition into /usr/include/opencascade/arch-6.5.0/Standard_Macro64.hxx
This file is shipped by libopencascade-foundation-6.5.0, because include
files are in arch:all packages and this macro must be set only on 64-bit archs.
Closes: #486386
Gbp-Pq: Name OCC64.patch
fi; \
if [ "$$pd" != "$$bd" ]; then \
cp -fr$(CP_$(platform)) $$bd/config.h $(DESTDIR)$(prefix); \
+ $(INSTALL) -d $(DESTDIR)$(prefix)/inc/arch-6.5.0; \
+ cp -f$(CP_$(platform)) $$bd/inc/arch-6.5.0/Standard_Macro64.hxx $(DESTDIR)$(prefix)/inc/arch-6.5.0; \
fi
if [ -e $(DESTDIR)$(prefix)/inc/config.h ]; then \
unlink $(DESTDIR)$(prefix)/inc/config.h; \
#
#---------------------------------------------------------------------
AC_MSG_CHECKING([if platform is 64-bit])
+OCC_define_OCC64="#undef _OCC64"
AC_TRY_COMPILE( [],
[int array[((int)sizeof(void*))-6];],
- [AC_MSG_RESULT([yes]); CPPFLAGS="$CPPFLAGS -D_OCC64"; case $platform in Linux*) CPPFLAGS="$CPPFLAGS -m64";; esac],
+ [AC_MSG_RESULT([yes]); OCC_define_OCC64="#define _OCC64 1"],
[AC_MSG_RESULT([no])] )
+AC_SUBST(OCC_define_OCC64)
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--enable-debug],[Debug Symbols])],
adm/make/TKXDEDRAW/Makefile \
adm/make/TKTObjDRAW/Makefile \
adm/make/DRAWEXE/Makefile \
+inc/arch-6.5.0/Standard_Macro64.hxx \
])
# endif // __Standard_API
// Define _OCC64 variable (unless already defined) if platform is known to be 64-bit
-#ifndef _OCC64
-#if defined (__alpha) || defined(DECOSF1) || defined(_WIN64) || defined(__amd64) || defined(__x86_64)
-#define _OCC64 1
-#endif
-#endif
+#include <arch-6.5.0/Standard_Macro64.hxx>
#endif
--- /dev/null
+#ifndef _Standard_Macro64_HeaderFile
+# define _Standard_Macro64_HeaderFile
+
+// This file must not be included directly because its name may change.
+#ifndef _Standard_Macro_HeaderFile
+# error "Standard_Macro64.hxx must not be included directly, include Standard_Macro.hxx instead!"
+#endif
+
+// Define _OCC64 variable on 64-bit platforms
+@OCC_define_OCC64@
+
+#endif
#include <Standard_NullObject.hxx>
#include <Standard_DivideByZero.hxx>
#include <Standard_Overflow.hxx>
+#include <Standard_Macro.hxx>
#include <Standard_ErrorHandler.hxx>