summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-13 13:27:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:51 -0500
commit0bd8d427d0ebe324ee40dfd18970a336b4740079 (patch)
treeacfa722ff8d84080bb067dcdf8bed61df0938c15 /source4
parent2475863ce77e26d5dc285b9dede56f2d0120e446 (diff)
downloadsamba-0bd8d427d0ebe324ee40dfd18970a336b4740079.tar.gz
samba-0bd8d427d0ebe324ee40dfd18970a336b4740079.tar.bz2
samba-0bd8d427d0ebe324ee40dfd18970a336b4740079.zip
r2951: fixed the intptr_t test for discard_const()
(This used to be commit 3318cf2722597e57d1731152b2607f6b167e45b9)
Diffstat (limited to 'source4')
-rw-r--r--source4/build/m4/rewrite.m42
-rw-r--r--source4/include/includes.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4
index 8d55a5b40a..8c40e91714 100644
--- a/source4/build/m4/rewrite.m4
+++ b/source4/build/m4/rewrite.m4
@@ -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)
############################################
diff --git a/source4/include/includes.h b/source4/include/includes.h
index 94d15eff3f..86ddc81e57 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -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 */