diff --git a/LOG b/LOG index b0623bb23e..3fe7ea217c 100644 --- a/LOG +++ b/LOG @@ -962,3 +962,6 @@ csug/foreign.stex, examples/socket.ss - add an option --disable-x11 c/version.h, configure +- allow s_ee_get_clipboard to use the pastebuffer on macOS even when X11 is not + available. + expeditor.c diff --git a/c/expeditor.c b/c/expeditor.c index 84c38971ca..78f6be3bfb 100644 --- a/c/expeditor.c +++ b/c/expeditor.c @@ -888,8 +888,10 @@ static void s_ee_line_feed(void) { #include #include #include +#endif /* LIBX11 */ static ptr s_ee_get_clipboard(void) { +#ifdef LIBX11 static enum {UNINITIALIZED, INITIALIZED, FAILED} status = UNINITIALIZED; static int (*pXConvertSelection)(Display *, Atom, Atom, Atom, Window, Time); static int (*pXPending)(Display *display); @@ -899,9 +901,11 @@ static ptr s_ee_get_clipboard(void) { static Display *D; static Window R, W; +#endif /* LIBX11 */ ptr p = S_G.null_string; +#ifdef LIBX11 if (status == UNINITIALIZED) { char *display_name; void *handle; @@ -986,6 +990,7 @@ static ptr s_ee_get_clipboard(void) { } } } +#endif /* LIBX11 */ #ifdef MACOSX #define PBPASTEBUFSIZE 1024 @@ -1013,11 +1018,6 @@ static ptr s_ee_get_clipboard(void) { return p; } -#else /* LIBX11 */ -static ptr s_ee_get_clipboard(void) { - return S_G.null_string; -} -#endif static void s_ee_write_char(wchar_t wch) { locale_t old; char buf[MB_LEN_MAX]; size_t n;