]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
linux kernel lacks uintptr
authorDerrick Brashear <shadow@dementia.org>
Mon, 4 Jan 2010 22:57:30 +0000 (17:57 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Fri, 8 Jan 2010 18:53:58 +0000 (10:53 -0800)
sadly only recent kernels include uintptr_t. change the cast to use unsigned
long

Change-Id: Ib69f7aa0f2d316c5ea8bdc960b15ee0f89f96250
Reviewed-on: http://gerrit.openafs.org/1059
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 165571947be770645900bb8d55ba7b6a3c58f8fd)
Reviewed-on: http://gerrit.openafs.org/1081

acinclude.m4
src/afs/afs_call.c

index b76f8d6f73b6698a2a6b0b12c265db91dcbb719f..65380560df4ae4a497ac34198498ca464c2ae9d0 100644 (file)
@@ -1419,6 +1419,10 @@ else
     AC_MSG_RESULT(no)
 fi
        
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(unsigned long long)
+AC_CHECK_SIZEOF(unsigned long)
+AC_CHECK_SIZEOF(unsigned int)
 AC_CHECK_TYPE(ssize_t, int)
 AC_SIZEOF_TYPE(long)
 
index 3b2b4a03155c134a3eee58d14bf5178ab19a19c7..5e0058cab14ad2203d7e5e6388f0cea77d3c700c 100644 (file)
@@ -1396,13 +1396,22 @@ struct iparam32 {
 
 
 #if defined(AFS_HPUX_64BIT_ENV) || defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV)) || defined(NEED_IOCTL32)
+#if SIZEOF_VOID_P == SIZEOF_UNSIGNED_INT
+# define uintptrsz unsigned int
+#elif SIZEOF_VOID_P == SIZEOF_UNSIGNED_LONG
+# define uintptrsz unsigned long
+#elif SIZEOF_VOID_P == SIZEOF_UNSIGNED_LONG_LONG
+# define uintptrsz unsigned long long
+#else
+# error "Unable to determine casting for pointers"
+#endif
 static void
 iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst)
 {
-    dst->param1 = (iparmtype)(uintptr_t)src->param1;
-    dst->param2 = (iparmtype)(uintptr_t)src->param2;
-    dst->param3 = (iparmtype)(uintptr_t)src->param3;
-    dst->param4 = (iparmtype)(uintptr_t)src->param4;
+    dst->param1 = (iparmtype)(uintptrsz)src->param1;
+    dst->param2 = (iparmtype)(uintptrsz)src->param2;
+    dst->param3 = (iparmtype)(uintptrsz)src->param3;
+    dst->param4 = (iparmtype)(uintptrsz)src->param4;
 }
 #endif