[vtkusers] #Defines for Big or Little Endian

Sean McBride sean at rogue-research.com
Fri Sep 1 14:22:53 EDT 2006


On 2006-09-01 12:03, Mike Jackson said:

>As a follow up to my own post I think that in the vtkConfigure.h on OS X I
>think that there needs to be something like:
>
>/* Byte order.  */
>#if defined(__i386__) && defined(__GNUC__)
>    #undef VTK_WORDS_BIGENDIAN
>#elif defined(__ppc__) && defined(__GNUC__)
>    #define VTK_WORDS_BIGENDIAN
>#else
>#error Do not know the endianess of this architecture
>#endif
>
>At the top. This is pretty much what Apple uses in there own files. Testing
>is required.. Maybe put this into the next version of VTK to help out those
>of us trying to compile universal binaries?

Well, this is all related to bug 3059. :)  Which I encourage you to
read.  <http://www.vtk.org/Bug/bug.php?op=show&bugid=3059>

I would dearly like for vtk to stop checking the endianess of the
machine that's doing the building.  But in order for that to happen, we
need a way to know the endianess of the target.  All compilers on Mac OS
set up the  __LITTLE_ENDIAN__ and __BIG_ENDIAN__ #defines, but other
compilers on other platforms don't.  So, like you say, we could hack it
to #undef and redefine VTK_WORDS_BIGENDIAN on Mac OS.

I'm willing to do it and test it, but I don't know enough about CMAKE
and how vtkConfigure.h is generated to get any farther.

If anyone can help, please update bug 3059. :)

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtkusers mailing list