Index: inc/sal/types.h =================================================================== RCS file: /cvs/porting/sal/inc/sal/types.h,v retrieving revision 1.25 retrieving revision 1.25.110.1 diff -u -r1.25 -r1.25.110.1 --- inc/sal/types.h 27 Oct 2004 15:21:17 -0000 1.25 +++ inc/sal/types.h 13 Sep 2005 14:50:34 -0000 1.25.110.1 @@ -158,16 +158,37 @@ typedef void * sal_Handle; /* sal_Size should currently be the native width of the platform */ -#if SAL_TYPES_SIZEOFLONG == 4 +#if SAL_TYPES_SIZEOFPOINTER == 4 typedef sal_uInt32 sal_Size; typedef sal_Int32 sal_sSize; -#elif SAL_TYPES_SIZEOFLONG == 8 +#elif SAL_TYPES_SIZEOFPOINTER == 8 typedef sal_uInt64 sal_Size; typedef sal_Int64 sal_sSize; #else - #error "Please make sure SAL_TYPES_SIZEOFLONG is defined for your architecture/compiler" + #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler" #endif +/* sal_PtrDiff holds the result of a pointer subtraction */ +#if SAL_TYPES_SIZEOFPOINTER == 4 + typedef sal_Int32 sal_PtrDiff; +#elif SAL_TYPES_SIZEOFPOINTER == 8 + typedef sal_Int64 sal_PtrDiff; +#else + #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler" +#endif + +/* sal_IntPtr, sal_uIntPtr are integer types designed to hold pointers so that any valid + * pointer to void can be converted to this type and back to a pointer to void and the + * result will compare to the original pointer */ +#if SAL_TYPES_SIZEOFPOINTER == 4 + typedef sal_Int32 sal_IntPtr; + typedef sal_uInt32 sal_uIntPtr; +#elif SAL_TYPES_SIZEOFPOINTER == 8 + typedef sal_Int64 sal_IntPtr; + typedef sal_uInt64 sal_uIntPtr; +#else + #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler" +#endif /********************************************************************************/ /* Useful defines