r2951: fixed the intptr_t test for discard_const()
authorAndrew Tridgell <tridge@samba.org>
Wed, 13 Oct 2004 13:27:52 +0000 (13:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:51 +0000 (12:59 -0500)
(This used to be commit 3318cf2722597e57d1731152b2607f6b167e45b9)

source4/build/m4/rewrite.m4
source4/include/includes.h

index 8d55a5b40a8c4f9f90c78da3c24bd6132bb80b7a..8c40e91714995b7100a93fd548eb021adb0eaea1 100644 (file)
@@ -275,7 +275,7 @@ AC_CHECK_TYPE(ino_t,unsigned)
 AC_CHECK_TYPE(loff_t,off_t)
 AC_CHECK_TYPE(offset_t,loff_t)
 AC_CHECK_TYPE(ssize_t, int)
-AC_CHECK_TYPE(intptr_t, void*)
+AC_CHECK_TYPES(intptr_t)
 
 
 ############################################
index 94d15eff3fe4cb00da43e464f637a5e8d9b3842a..86ddc81e579ed4f04104167205af1f80971858c4 100644 (file)
@@ -1089,7 +1089,11 @@ time_t timegm(struct tm *tm);
   Also, please call this via the discard_const_p() macro interface, as that
   makes the return type safe.
 */
+#ifdef HAVE_INTPTR_T
 #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
+#else
+#define discard_const(ptr) ((void *)(ptr))
+#endif
 #define discard_const_p(type, ptr) ((type *)discard_const(ptr))
 
 #endif /* _INCLUDES_H */