Skip to content

Commit 4dd6752

Browse files
committed
Fix #796; Clink can't load on Win7 or earlier.
A Readline change lacked correct guard conditions, and got compiled even though nothing could use it.
1 parent 6445be3 commit 4dd6752

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

readline/readline/gettimeofday.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636

3737
#ifdef WINDOWS_NATIVE
3838

39+
/* begin_clink_change
40+
* Make Readline load the API manually; don't dynamically link with it. */
41+
# undef _WIN32_WINNT
42+
# define _WIN32_WINNT 0
43+
/* end_clink_change */
44+
3945
# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
4046

4147
/* Avoid warnings from gcc -Wcast-function-type. */

readline/readline/input.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,22 @@ static int set_alarm (unsigned int *, unsigned int *);
167167
static void reset_alarm (void);
168168
#endif
169169

170+
/* begin_clink_change
171+
* This isn't used, so get rid of it. */
172+
#if 0
173+
/* end_clink_change */
174+
170175
/* We implement timeouts as a future time using a supplied interval
171176
(timeout_duration) from when the timeout is set (timeout_point).
172177
That allows us to easily determine whether the timeout has occurred
173178
and compute the time remaining until it does. */
174179
static struct timeval timeout_point;
175180
static struct timeval timeout_duration;
176181

182+
/* begin_clink_change */
183+
#endif
184+
/* end_clink_change */
185+
177186
/* **************************************************************** */
178187
/* */
179188
/* Character Input Buffering */
@@ -590,6 +599,11 @@ reset_alarm ()
590599
# endif /* !HAVE_SETITIMER */
591600
#endif /* RL_TIMEOUT_USE_SIGALRM */
592601

602+
/* begin_clink_change
603+
* This isn't used, so get rid of it. */
604+
#if 0
605+
/* end_clink_change */
606+
593607
/* Set a timeout which will be used for the next call of `readline
594608
()'. When (0, 0) are specified the timeout is cleared. */
595609
int
@@ -686,6 +700,18 @@ rl_timeout_remaining (unsigned int *secs, unsigned int *usecs)
686700
return 1;
687701
}
688702

703+
/* begin_clink_change */
704+
#else
705+
int
706+
_rl_timeout_init (void)
707+
{
708+
/* Clear the timeout state of the previous edit */
709+
RL_UNSETSTATE(RL_STATE_TIMEOUT);
710+
return 0;
711+
}
712+
#endif
713+
/* end_clink_change */
714+
689715
/* This should only be called if RL_TIMEOUT_USE_SELECT is defined. */
690716

691717
#if defined (RL_TIMEOUT_USE_SELECT)
@@ -752,6 +778,9 @@ _rl_timeout_select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptf
752778
}
753779
#endif
754780

781+
/* begin_clink_change */
782+
#if defined (RL_TIMEOUT_USE_SELECT) || defined (RL_TIMEOUT_USE_SIGALRM) || defined (SIGALARM) || defined (HAVE_PSELECT) || defined (HAVE_SELECT)
783+
/* end_clink_change */
755784
static void
756785
_rl_timeout_handle ()
757786
{
@@ -761,7 +790,13 @@ _rl_timeout_handle ()
761790
RL_SETSTATE(RL_STATE_TIMEOUT);
762791
_rl_abort_internal ();
763792
}
793+
/* begin_clink_change */
794+
#endif
795+
/* end_clink_change */
764796

797+
/* begin_clink_change */
798+
#if defined (SIGALARM)
799+
/* end_clink_change */
765800
int
766801
_rl_timeout_handle_sigalrm ()
767802
{
@@ -780,6 +815,9 @@ _rl_timeout_handle_sigalrm ()
780815
#endif
781816
return -1;
782817
}
818+
/* begin_clink_change */
819+
#endif
820+
/* end_clink_change */
783821
/* **************************************************************** */
784822
/* */
785823
/* Character Input */

0 commit comments

Comments
 (0)