On 2008/6/15, Adam C Powell IV wrote:
> Package: libopencascade-dev
> Severity: important
>
> Greetings,
>
> Standard_Macro.hxx includes the _OCC64 macro definition, which will be
> different on 64-bit vs. 32-bit platforms.  This file needs to move to an
> arch-dependent package, such as the shlibs -- even though that's a bit
> non-kosher (it's a really small file, so it shouldn't matter much).

Indeed, here is an untested patch against 6.2-4,

Denis
diff --git a/debian/libopencascade6.2.files b/debian/libopencascade6.2.files
index 09b45a3..f99f3c9 100644
--- a/debian/libopencascade6.2.files
+++ b/debian/libopencascade6.2.files
@@ -8,3 +8,4 @@ usr/share/opencascade/6.2/src/XmlOcafResource/*
 usr/share/opencascade/6.2/src/SHMessage/*
 usr/share/opencascade/6.2/src/XSMessage/*
 usr/share/opencascade/6.2/src/XSTEPResource/*
+usr/include/opencascade/arch/Standard_Macro64.hxx
diff --git a/debian/patches/OCC64.patch b/debian/patches/OCC64.patch
index 94a94fe..2b2d420 100644
--- a/debian/patches/OCC64.patch
+++ b/debian/patches/OCC64.patch
@@ -32,67 +32,8 @@ diff -aur occ6.2/ros/configure.in mod/ros/configure.in
  adm/make/WOKSH/Makefile \
  adm/make/WOKLibs/Makefile \
  adm/make/TKjcas/Makefile \
-+inc/Standard_Macro.hxx \
++inc/arch/Standard_Macro64.hxx \
  ])
---- /dev/null
-+++ mod/ros/inc/Standard_Macro.hxx.in
-@@ -0,0 +1,56 @@
-+#ifndef _Standard_Macro_HeaderFile
-+# define _Standard_Macro_HeaderFile
-+
-+# define	  Handle(ClassName)  Handle_##ClassName
-+# define	  Oid(ClassName)     Oid_##ClassName
-+
-+# define   STANDARD_TYPE(aType)   aType##_Type_()
-+
-+# if defined(WNT) && !defined(HAVE_NO_DLL)
-+
-+#  ifndef Standard_EXPORT
-+#   define Standard_EXPORT __declspec( dllexport )
-+// For global variables :
-+#   define Standard_EXPORTEXTERN __declspec( dllexport ) extern
-+#   define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
-+#  endif  /* Standard_EXPORT */
-+
-+#  ifndef Standard_IMPORT
-+#   define Standard_IMPORT __declspec( dllimport ) extern
-+#   define Standard_IMPORTC extern "C" __declspec( dllimport )
-+#  endif  /* Standard_IMPORT */
-+
-+# else  /* WNT */
-+
-+#  ifndef Standard_EXPORT
-+#   define Standard_EXPORT
-+// For global variables :
-+#   define Standard_EXPORTEXTERN extern
-+#   define Standard_EXPORTEXTERNC extern "C"
-+#  endif  /* Standard_EXPORT */
-+
-+#  ifndef Standard_IMPORT
-+#   define Standard_IMPORT extern
-+#   define Standard_IMPORTC extern "C"
-+#  endif  /* Standard_IMPORT */
-+
-+# endif  /* WNT */
-+
-+# ifndef __Standard_API
-+//#  ifdef WNT
-+#   if !defined(WNT) || defined(__Standard_DLL) || defined(__FSD_DLL) || defined(__MMgt_DLL) || defined(__OSD_DLL) || defined(__Plugin_DLL) || defined(__Quantity_DLL) || defined(__Resource_DLL) || defined(__SortTools_DLL) || defined(__StdFail_DLL) || defined(__Storage_DLL) || defined(__TColStd_DLL) || defined(__TCollection_DLL) || defined(__TShort_DLL) || defined(__Units_DLL) || defined(__UnitsAPI_DLL) || defined(__Dico_DLL)
-+#    define __Standard_API Standard_EXPORT
-+#    define __Standard_APIEXTERN Standard_EXPORTEXTERN
-+#   else
-+#    define __Standard_API Standard_IMPORT
-+#    define __Standard_APIEXTERN Standard_IMPORT
-+#   endif  // __Standard_DLL
-+//#  else
-+//#   define __Standard_API
-+//#  endif  // WNT
-+# endif  // __Standard_API
-+
-+// Define _OCC64 variable on 64-bit platforms
[EMAIL PROTECTED]@
-+
-+#endif  
 --- opencascade-6.2/ros/src/CPPExt/CPPExt_Standard.edl~	2007-03-21 17:13:42.000000000 -0400
 +++ opencascade-6.2/ros/src/CPPExt/CPPExt_Standard.edl	2008-06-12 13:26:47.000000000 -0400
 @@ -18,7 +18,7 @@
@@ -123,3 +64,29 @@ diff -aur occ6.2/ros/configure.in mod/ros/configure.in
  #define UndefinedHandleAddress ((Standard_Transient *)0xfefdfefdfefd0000)
  #else
  #define UndefinedHandleAddress ((Standard_Transient *)0xfefd0000)
+--- opencascade-6.2.orig/ros/inc/Standard_Macro.hxx
++++ opencascade-6.2/ros/inc/Standard_Macro.hxx
+@@ -51,10 +51,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)
+-#define _OCC64 1
+-#endif
+-#endif
++#include <arch/Standard_Macro64.hxx>
+ 
+ #endif  
+Index: opencascade-6.2/ros/inc/arch/Standard_Macro64.hxx.in
+===================================================================
+--- /dev/null
++++ opencascade-6.2/ros/inc/arch/Standard_Macro64.hxx.in
+@@ -0,0 +1,7 @@
++#ifndef _Standard_Macro64_HeaderFile
++# define _Standard_Macro64_HeaderFile
++
++// Define _OCC64 variable on 64-bit platforms
[EMAIL PROTECTED]@
++
++#endif  
diff --git a/debian/rules b/debian/rules
index 43acc04..43e03de 100755
--- a/debian/rules
+++ b/debian/rules
@@ -61,7 +61,7 @@ install: build
 	$(MAKE) -C ros install DESTDIR=$(CURDIR)/debian/tmp
 	# Why doesn't OpenCASCADE install its own headers??
 	cp -a ros/inc debian/tmp/usr/
-	rm -f debian/tmp/usr/inc/config.h debian/tmp/usr/inc/Standard_Macro.hxx.in
+	rm -f debian/tmp/usr/inc/config.h debian/tmp/usr/inc/arch/Standard_Macro64.hxx.in
 	cp -a ros/config.h debian/tmp/usr/inc/
 	install -d debian/tmp/usr/include
 	mv debian/tmp/usr/inc debian/tmp/usr/include/opencascade

Reply via email to