diff --git a/src/keyboard.c b/src/keyboard.c index 0cf7adae741..d2f0cb405f0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3647,7 +3647,8 @@ kbd_buffer_unget_event (struct selection_input_event *event) #define INPUT_EVENT_POS_MAX \ ((ptrdiff_t) min (PTRDIFF_MAX, min (TYPE_MAXIMUM (Time) / 2, \ MOST_POSITIVE_FIXNUM))) -#define INPUT_EVENT_POS_MIN (-1 - INPUT_EVENT_POS_MAX) +#define INPUT_EVENT_POS_MIN (PTRDIFF_MIN < -INPUT_EVENT_POS_MAX \ + ? -1 - INPUT_EVENT_POS_MAX : PTRDIFF_MIN) /* Return a Time that encodes position POS. POS must be in range. */