[vtk-developers] Guidance needed fixing problems doing 64bit compile on Mac OS X

David Gobbi dgobbi at atamai.com
Thu Oct 26 13:00:04 EDT 2006


Sean McBride wrote:
> On 2006-10-26 12:40, David Gobbi said:
>
>   
>> A "long" would do the trick, I believe that the C standard requires it 
>> to be as big as a pointer, and this would cause an absolute minimum of 
>> backwards-compatibility issues.
>>     
>
> Actually C only requires long to be at least as big as int.  In fact, if
> you look at the table on this page:
>
> <http://developer.apple.com/macosx/64bit.html>
>
> We see that in the real world(TM) long is not always 64 bit, even on 64 bit
> systems.
>
> The type 'ptrdiff_t' is a special type (like size_t) who's exact purpose
> is to be an integer type big enough to hold pointers.
>
> There may possibly be some crappy compilers out there that don't support
> ptrdiff_t, but I would be surprised.
>   

As David Cole mentioned, basic types are preferred to ease integration 
with scripting languages.
I really don't like to use types like ptrdiff_t as part of any VTK 
interface (internal or otherwise)
because of this.

On UNIX/Linux (i.e. X) a long is sufficient, and the only other 
platforms we need to worry
about are Mac and Windows.  So if long will work on Mac and Windows, it 
seems like the
best choice.

 - David







More information about the vtk-developers mailing list