[vtkusers] bug fix to build on Linux/PowerPC
Steven G. Johnson
stevenj at ab-initio.mit.edu
Sun Jul 22 17:08:28 EDT 2001
Hi, I am using Debian GNU/Linux on a PowerPC (Apple PowerBook G3), and I
ran into a small problem (easily fixed) in building VTK (using the nightly
VTK update as of Jul 21). (A similar problem was present in version 3.2,
which was why I switched to the nightly update before attempting a fix.)
The problem is in common/vtkDynamicLoader.h, which has lines:
#elif defined(__powerpc)
typedef ConnectionID vtkLibHandle;
#else
which, in the 3.2 sources, were used to support MacOS on PowerPCs.
Obviously, this causes problems on Linux/PowerPC, for which __powerpc is
defined but MacOS types are not present. Moreover, this code is not even
used any more; the corresponding routines in vtkDynamicLoader.cxx, which
is there in version 3.2, was deleted from the nightly version in favor of
new code for Darwin (& MacOS X).
So, the simplest fix seemed to be to delete it; here is the patch, after
which VTK builds successfully:
--- vtkDynamicLoader.h.orig Sat Jul 21 13:41:36 2001
+++ vtkDynamicLoader.h Sat Jul 21 13:41:04 2001
@@ -59,8 +59,6 @@
#elif defined(_WIN32)
# include "windows.h"
typedef HMODULE vtkLibHandle;
-#elif defined(__powerpc)
- typedef ConnectionID vtkLibHandle;
#else
typedef void* vtkLibHandle;
#endif
(In the long run, it would really be better if you used autoconf to detect
this sort of thing, instead of relying upon compiler-specific ifdefs.)
I hope that this fix will make it into a future release; thanks!
Cordially,
Steven G. Johnson
PS. Sorry if this is not the right place for bug reports & patches; I
couldn't find any other contact addresses.
More information about the vtkusers
mailing list