+/* Smallest integral type capable of holding a pointer. */
+#ifndef _UINTPTR_T
+#define _UINTPTR_T
+#ifdef _WIN32
+
+/* WIN32 is an ILP32 platform */
+typedef unsigned long uintptr_t;
+
+#else /* _WIN32 */
+
+/* what about 64-bit windows?
+ * what's the right preprocessor symbol?
+typedef unsigned long long uintptr_t */
+
+/* ILP32 and LP64 platforms */
+typedef unsigned long uintptr_t;
+
+#endif /* _WIN32 */
+#endif /* _UINTPTR_T */
+
+/* Perform an unsigned cast to uintptr_t. */
+#define cast_to_pointer_integral_type(value) \
+ ((uintptr_t)(value))
+
+/* Perform a cast of a pointer to uintmax_t */
+#define cast_ptr_to_largest_integral_type(value) \
+cast_to_largest_integral_type(cast_to_pointer_integral_type(value))
+