summaryrefslogtreecommitdiff
path: root/source4/include
diff options
context:
space:
mode:
Diffstat (limited to 'source4/include')
-rw-r--r--source4/include/includes.h4
1 files changed, 4 insertions, 0 deletions
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 */