X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4dc7c8d5795458e89d19b59f64760e155c2cd70b..49cdacdad393e2b9282a19a963030dfbe1a738ab:/src/w32select.c
diff --git a/src/w32select.c b/src/w32select.c
index 1d4a6f41bd..1b10c74cfe 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1,4 +1,4 @@
-/* Selection processing for Emacs on the Microsoft W32 API.
+/* Selection processing for Emacs on the Microsoft Windows API.
Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
@@ -73,15 +73,20 @@ along with GNU Emacs. If not, see . */
*/
#include
-#include
#include "lisp.h"
#include "w32term.h" /* for all of the w32 includes */
-#include "w32heap.h" /* os_subtype */
+#include "w32common.h" /* os_subtype */
+#include "keyboard.h"
#include "blockinput.h"
#include "charset.h"
#include "coding.h"
#include "composite.h"
+#ifdef CYGWIN
+#include
+#include
+#define _memccpy memccpy
+#endif
static HGLOBAL convert_to_handle_as_ascii (void);
static HGLOBAL convert_to_handle_as_coded (Lisp_Object coding_system);
@@ -389,12 +394,11 @@ run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg)
with global variables and calling strange looking functions. Is
this really the right way to run Lisp callbacks? */
- extern int waiting_for_input; /* from keyboard.c */
int owfi;
- BLOCK_INPUT;
+ block_input ();
- /* Fsignal calls abort() if it sees that waiting_for_input is
+ /* Fsignal calls emacs_abort () if it sees that waiting_for_input is
set. */
owfi = waiting_for_input;
waiting_for_input = 0;
@@ -403,7 +407,7 @@ run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg)
waiting_for_input = owfi;
- UNBLOCK_INPUT;
+ unblock_input ();
}
static Lisp_Object
@@ -475,7 +479,10 @@ term_w32select (void)
{
/* This is needed to trigger WM_RENDERALLFORMATS. */
if (clipboard_owner != NULL)
- DestroyWindow (clipboard_owner);
+ {
+ DestroyWindow (clipboard_owner);
+ clipboard_owner = NULL;
+ }
}
static void
@@ -695,7 +702,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
current_num_nls = 0;
current_requires_encoding = 0;
- BLOCK_INPUT;
+ block_input ();
/* Check for non-ASCII characters. While we are at it, count the
number of LFs, so we know how many CRs we will have to add later
@@ -783,7 +790,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
current_coding_system = Qnil;
done:
- UNBLOCK_INPUT;
+ unblock_input ();
return (ok ? string : Qnil);
}
@@ -811,7 +818,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
setup_config ();
actual_clipboard_type = cfg_clipboard_type;
- BLOCK_INPUT;
+ block_input ();
if (!OpenClipboard (clipboard_owner))
goto done;
@@ -1001,7 +1008,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
CloseClipboard ();
done:
- UNBLOCK_INPUT;
+ unblock_input ();
return (ret);
}