mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-23 20:03:31 +01:00
Compile time check for being able to fit {unsigned} int inside void pointer
This commit is contained in:
parent
72e0dc0822
commit
13b28063f9
@ -1588,6 +1588,7 @@ AC_CHECK_MEMBERS([struct timeval.tv_sec], , ,
|
|||||||
AC_CHECK_SIZEOF(char)
|
AC_CHECK_SIZEOF(char)
|
||||||
AC_CHECK_SIZEOF(short)
|
AC_CHECK_SIZEOF(short)
|
||||||
AC_CHECK_SIZEOF(int)
|
AC_CHECK_SIZEOF(int)
|
||||||
|
AC_CHECK_SIZEOF(unsigned int)
|
||||||
AC_CHECK_SIZEOF(long)
|
AC_CHECK_SIZEOF(long)
|
||||||
AC_CHECK_SIZEOF(long long)
|
AC_CHECK_SIZEOF(long long)
|
||||||
AC_CHECK_SIZEOF(__int64)
|
AC_CHECK_SIZEOF(__int64)
|
||||||
|
@ -11,6 +11,15 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <limits.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. */
|
/** Assert that <b>a</b> can be cast to void * and back. */
|
||||||
static void
|
static void
|
||||||
assert_int_voidptr_roundtrip(int a)
|
assert_int_voidptr_roundtrip(int a)
|
||||||
|
Loading…
Reference in New Issue
Block a user