From 68260e85b5fd4f5e0bb87a4c58b187a8309b0cb5 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Mon, 25 Mar 2019 10:17:30 +0200 Subject: [PATCH] Move sizeof check to torint.h --- src/lib/cc/torint.h | 9 +++++++++ src/test/test_ptr_slow.c | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/cc/torint.h b/src/lib/cc/torint.h index c9b2d329f2..9a66aada18 100644 --- a/src/lib/cc/torint.h +++ b/src/lib/cc/torint.h @@ -125,4 +125,13 @@ typedef int32_t ssize_t; /** Any size_t larger than this amount is likely to be an underflow. */ #define SIZE_T_CEILING ((size_t)(SSIZE_MAX-16)) +#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 + #endif /* !defined(TOR_TORINT_H) */ diff --git a/src/test/test_ptr_slow.c b/src/test/test_ptr_slow.c index 2d4fc9d4dd..76bdbf1891 100644 --- a/src/test/test_ptr_slow.c +++ b/src/test/test_ptr_slow.c @@ -11,15 +11,6 @@ #include #include -#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 a can be cast to void * and back. */ static void assert_int_voidptr_roundtrip(int a)