mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Add intptr_t and uintptr_t to torint.h
svn:r1794
This commit is contained in:
parent
e6ac85a8cc
commit
8aebd83a0e
@ -153,8 +153,10 @@ AC_CHECK_SIZEOF(uint8_t)
|
|||||||
AC_CHECK_SIZEOF(uint16_t)
|
AC_CHECK_SIZEOF(uint16_t)
|
||||||
AC_CHECK_SIZEOF(uint32_t)
|
AC_CHECK_SIZEOF(uint32_t)
|
||||||
AC_CHECK_SIZEOF(uint64_t)
|
AC_CHECK_SIZEOF(uint64_t)
|
||||||
|
AC_CHECK_SIZEOF(intptr_t)
|
||||||
|
AC_CHECK_SIZEOF(uintptr_t)
|
||||||
|
|
||||||
dnl AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t])
|
dnl AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, intptr_t, uintptr_t])
|
||||||
|
|
||||||
AC_CHECK_SIZEOF(char)
|
AC_CHECK_SIZEOF(char)
|
||||||
AC_CHECK_SIZEOF(short)
|
AC_CHECK_SIZEOF(short)
|
||||||
@ -162,6 +164,7 @@ AC_CHECK_SIZEOF(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)
|
||||||
|
AC_CHECK_SIZEOF(void *)
|
||||||
|
|
||||||
# Now, let's see about alignment requirements
|
# Now, let's see about alignment requirements
|
||||||
AC_CACHE_CHECK([whether unaligned int access is allowed], tor_cv_unaligned_ok,
|
AC_CACHE_CHECK([whether unaligned int access is allowed], tor_cv_unaligned_ok,
|
||||||
|
@ -44,6 +44,12 @@
|
|||||||
#if (SIZEOF_UINT64_T != 0)
|
#if (SIZEOF_UINT64_T != 0)
|
||||||
#define HAVE_UINT64_T
|
#define HAVE_UINT64_T
|
||||||
#endif
|
#endif
|
||||||
|
#if (SIZEOF_INTPTR_T != 0)
|
||||||
|
#define HAVE_INTPTR_T
|
||||||
|
#endif
|
||||||
|
#if (SIZEOF_UINTPTR_T != 0)
|
||||||
|
#define HAVE_UINTPTR_T
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (SIZEOF_CHAR == 1)
|
#if (SIZEOF_CHAR == 1)
|
||||||
#ifndef HAVE_INT8_T
|
#ifndef HAVE_INT8_T
|
||||||
@ -131,6 +137,23 @@ typedef unsigned __int64 uint64_t;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8)
|
||||||
|
#ifndef HAVE_INTPTR_T
|
||||||
|
typedef int64_t intptr_t;
|
||||||
|
#endif
|
||||||
|
#ifndef HAVE_UINTPTR_T
|
||||||
|
typedef uint64_t uintptr_t;
|
||||||
|
#endif
|
||||||
|
#elif (SIZEOF_VOID_P > 2 && SIZEOF_VOID_P <= 4)
|
||||||
|
#ifndef HAVE_INTPTR_T
|
||||||
|
typedef int32_t intptr_t;
|
||||||
|
#endif
|
||||||
|
#ifndef HAVE_UINTPTR_T
|
||||||
|
typedef uint32_t uintptr_t;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#error "void * is either >8 bytes or <= 2. In either case, I am confused."
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_INT8_T
|
#ifndef HAVE_INT8_T
|
||||||
#error "Missing type int8_t"
|
#error "Missing type int8_t"
|
||||||
|
Loading…
Reference in New Issue
Block a user