diff --git a/configure.ac b/configure.ac
index 6036cdffe5c9d79639bf3f7c76cbed09baa088a8..8ac2d71e4f8a1c3a2471f49d7e19f1c735ba23d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1588,6 +1588,7 @@ AC_CHECK_MEMBERS([struct timeval.tv_sec], , ,
 AC_CHECK_SIZEOF(char)
 AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(unsigned int)
 AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
 AC_CHECK_SIZEOF(__int64)
diff --git a/src/test/test_ptr_slow.c b/src/test/test_ptr_slow.c
index 0142fd1c8a04274e9f1fd20ab5556ebfb9545727..37560d4359806bfa8668f84d08f5d312949742f6 100644
--- a/src/test/test_ptr_slow.c
+++ b/src/test/test_ptr_slow.c
@@ -11,6 +11,15 @@
 #include <stdint.h>
 #include <limits.h>
 
+#if SIZEOF_INT > SIZEOF_VOID_P
+#error "sizeof(int) > sizeof(void *) - Tor cannot be built on this platform!"
+#endif
+
+#if SIZEOF_UNSIGNED_INT > SIZEOF_VOID_P
+#error "sizeof(unsigned int) > sizeof(void *) - Tor cannot be built on this \
+platform!"
+#endif
+
 /** Assert that <b>a</b> can be cast to void * and back. */
 static void
 assert_int_voidptr_roundtrip(int a)