Merge remote-tracking branch 'public/bug18184'

This commit is contained in:
Nick Mathewson 2016-02-10 15:36:48 -05:00
commit 4dc8dc4b89
5 changed files with 9 additions and 33 deletions

5
changes/bug18184 Normal file
View File

@ -0,0 +1,5 @@
o Removed platform support:
- Tor no longer attempts to support platforms where the "time_t" type
is unsigned. (To the best of our knowledge, only OpenVMS does this,
and Tor has never actually built on OpenVMS.) Closes ticket 18184.

View File

@ -1176,7 +1176,7 @@ AC_CHECK_TYPES([rlim_t], , ,
]) ])
AX_CHECK_SIGN([time_t], AX_CHECK_SIGN([time_t],
[ AC_DEFINE(TIME_T_IS_SIGNED, 1, [Define if time_t is signed]) ], [ : ],
[ : ], [ [ : ], [
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
@ -1190,7 +1190,7 @@ AX_CHECK_SIGN([time_t],
]) ])
if test "$ax_cv_decl_time_t_signed" = no; then if test "$ax_cv_decl_time_t_signed" = no; then
AC_MSG_WARN([You have an unsigned time_t; some things will probably break. Please tell the Tor developers about your interesting platform.]) AC_MSG_ERROR([You have an unsigned time_t; Tor does not support that. Please tell the Tor developers about your interesting platform.])
fi fi
AX_CHECK_SIGN([size_t], AX_CHECK_SIGN([size_t],

View File

@ -312,8 +312,6 @@ typedef uint32_t uintptr_t;
#ifndef TIME_MAX #ifndef TIME_MAX
#ifdef TIME_T_IS_SIGNED
#if (SIZEOF_TIME_T == SIZEOF_INT) #if (SIZEOF_TIME_T == SIZEOF_INT)
#define TIME_MAX ((time_t)INT_MAX) #define TIME_MAX ((time_t)INT_MAX)
#elif (SIZEOF_TIME_T == SIZEOF_LONG) #elif (SIZEOF_TIME_T == SIZEOF_LONG)
@ -321,25 +319,13 @@ typedef uint32_t uintptr_t;
#elif (SIZEOF_TIME_T == 8) #elif (SIZEOF_TIME_T == 8)
#define TIME_MAX ((time_t)INT64_MAX) #define TIME_MAX ((time_t)INT64_MAX)
#else #else
#error "Can't define (signed) TIME_MAX" #error "Can't define TIME_MAX"
#endif #endif
#else
/* Unsigned case */
#if (SIZEOF_TIME_T == 4)
#define TIME_MAX ((time_t)UINT32_MAX)
#elif (SIZEOF_TIME_T == 8)
#define TIME_MAX ((time_t)UINT64_MAX)
#else
#error "Can't define (unsigned) TIME_MAX"
#endif
#endif /* time_t_is_signed */
#endif /* ifndef(TIME_MAX) */ #endif /* ifndef(TIME_MAX) */
#ifndef TIME_MIN #ifndef TIME_MIN
#ifdef TIME_T_IS_SIGNED
#if (SIZEOF_TIME_T == SIZEOF_INT) #if (SIZEOF_TIME_T == SIZEOF_INT)
#define TIME_MIN ((time_t)INT_MIN) #define TIME_MIN ((time_t)INT_MIN)
#elif (SIZEOF_TIME_T == SIZEOF_LONG) #elif (SIZEOF_TIME_T == SIZEOF_LONG)
@ -347,19 +333,9 @@ typedef uint32_t uintptr_t;
#elif (SIZEOF_TIME_T == 8) #elif (SIZEOF_TIME_T == 8)
#define TIME_MIN ((time_t)INT64_MIN) #define TIME_MIN ((time_t)INT64_MIN)
#else #else
#error "Can't define (signed) TIME_MIN" #error "Can't define TIME_MIN"
#endif #endif
#else
/* Unsigned case */
#if (SIZEOF_TIME_T == 4)
#define TIME_MIN ((time_t)UINT32_MIN)
#elif (SIZEOF_TIME_T == 8)
#define TIME_MIN ((time_t)UINT64_MIN)
#else
#error "Can't define (unsigned) TIME_MIN"
#endif
#endif /* time_t_is_signed */
#endif /* ifndef(TIME_MIN) */ #endif /* ifndef(TIME_MIN) */
#ifndef SIZE_MAX #ifndef SIZE_MAX

View File

@ -3312,7 +3312,6 @@ test_dir_download_status_schedule(void *arg)
tt_assert(increment == expected_increment); tt_assert(increment == expected_increment);
tt_assert(dls_failure.next_attempt_at == TIME_MIN + expected_increment); tt_assert(dls_failure.next_attempt_at == TIME_MIN + expected_increment);
#if TIME_T_IS_SIGNED
delay1 = INT_MAX; delay1 = INT_MAX;
increment = download_status_schedule_get_delay(&dls_failure, increment = download_status_schedule_get_delay(&dls_failure,
schedule, schedule,
@ -3320,7 +3319,6 @@ test_dir_download_status_schedule(void *arg)
expected_increment = delay1; expected_increment = delay1;
tt_assert(increment == expected_increment); tt_assert(increment == expected_increment);
tt_assert(dls_failure.next_attempt_at == TIME_MAX); tt_assert(dls_failure.next_attempt_at == TIME_MAX);
#endif
delay1 = 0; delay1 = 0;
increment = download_status_schedule_get_delay(&dls_attempt, increment = download_status_schedule_get_delay(&dls_attempt,

View File

@ -220,9 +220,6 @@
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS #define STDC_HEADERS
/* Define to 1 if time_t is signed. */
#define TIME_T_IS_SIGNED
/* Define to 1 iff unaligned int access is allowed */ /* Define to 1 iff unaligned int access is allowed */
#define UNALIGNED_INT_ACCESS_OK #define UNALIGNED_INT_ACCESS_OK