From 46d010616a5a991978c4681828bc3d22b55df1b9 Mon Sep 17 00:00:00 2001 From: Debian Science Maintainers Date: Fri, 6 May 2011 14:52:41 +0100 Subject: [PATCH] OCC64 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 --- ros/Makefile.am | 2 ++ ros/configure.in | 5 ++++- ros/inc/Standard_Macro.hxx | 6 +----- ros/inc/arch-6.5.0/Standard_Macro64.hxx.in | 12 ++++++++++++ ros/src/OSD/OSD_signal.cxx | 1 + 5 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 ros/inc/arch-6.5.0/Standard_Macro64.hxx.in diff --git a/ros/Makefile.am b/ros/Makefile.am index 3dfd55d4b..37ae6f2eb 100644 --- a/ros/Makefile.am +++ b/ros/Makefile.am @@ -107,6 +107,8 @@ install-exec-local: 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; \ diff --git a/ros/configure.in b/ros/configure.in index d69152b3d..d4269d38c 100644 --- a/ros/configure.in +++ b/ros/configure.in @@ -662,10 +662,12 @@ LIBS="$LIBS_save" # #--------------------------------------------------------------------- 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])], @@ -980,4 +982,5 @@ adm/make/TKDCAF/Makefile \ adm/make/TKXDEDRAW/Makefile \ adm/make/TKTObjDRAW/Makefile \ adm/make/DRAWEXE/Makefile \ +inc/arch-6.5.0/Standard_Macro64.hxx \ ]) diff --git a/ros/inc/Standard_Macro.hxx b/ros/inc/Standard_Macro.hxx index fce21502d..96bae49c7 100644 --- a/ros/inc/Standard_Macro.hxx +++ b/ros/inc/Standard_Macro.hxx @@ -130,10 +130,6 @@ # 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 #endif diff --git a/ros/inc/arch-6.5.0/Standard_Macro64.hxx.in b/ros/inc/arch-6.5.0/Standard_Macro64.hxx.in new file mode 100644 index 000000000..e29cc568c --- /dev/null +++ b/ros/inc/arch-6.5.0/Standard_Macro64.hxx.in @@ -0,0 +1,12 @@ +#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 diff --git a/ros/src/OSD/OSD_signal.cxx b/ros/src/OSD/OSD_signal.cxx index 8c9d4875b..65bb607b2 100644 --- a/ros/src/OSD/OSD_signal.cxx +++ b/ros/src/OSD/OSD_signal.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include -- 2.30.2