]> code.delx.au - gnu-emacs/commitdiff
Fix Cygwin-w32 build
authorKen Brown <kbrown@cornell.edu>
Sun, 6 Mar 2016 17:08:39 +0000 (12:08 -0500)
committerKen Brown <kbrown@cornell.edu>
Sun, 6 Mar 2016 17:08:39 +0000 (12:08 -0500)
* src/w32fns.c (funhook, setup_w32_kbdhook, remove_w32_kbdhook):
Define only if WINDOWSNT, and update all uses accordingly.
* src/w32term.h (check_w32_winkey_state, setup_w32_kbdhook)
(remove_w32_kbdhook): Declare only if WINDOWSNT.
(w32_kbdhook_active): Define as 0 if not WINDOWSNT.

src/w32fns.c
src/w32term.h

index 10c8af7107389c3f96069bec92230c57d85a4b7a..0fe6a6fd2b35165b832f7fdaed00a6b1e3200e3f 100644 (file)
@@ -2112,6 +2112,7 @@ my_post_msg (W32Msg * wmsg, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
   post_msg (wmsg);
 }
 
+#ifdef WINDOWSNT
 /* The Windows keyboard hook callback.  */
 static LRESULT CALLBACK
 funhook (int code, WPARAM w, LPARAM l)
@@ -2370,6 +2371,7 @@ remove_w32_kbdhook (void)
       kbdhook.hook = NULL;
     }
 }
+#endif /* WINDOWSNT */
 
 /* Mark a specific key combination as hooked, preventing it to be
    handled by the system.  */
@@ -4734,12 +4736,16 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
       my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
       goto dflt;
 
+#ifdef WINDOWSNT
     case WM_CREATE:
       setup_w32_kbdhook ();
       goto dflt;
+#endif
 
     case WM_DESTROY:
+#ifdef WINDOWSNT
       remove_w32_kbdhook ();
+#endif
       CoUninitialize ();
       return 0;
 
index aed89d8c254779a8eb5b52c5be1f22bde72c9793..7c23bc43a1f17d82ba8cb8669c1141d0f7546d27 100644 (file)
@@ -738,11 +738,15 @@ extern int handle_file_notifications (struct input_event *);
 extern void w32_initialize_display_info (Lisp_Object);
 extern void initialize_w32_display (struct terminal *, int *, int *);
 
+#ifdef WINDOWSNT
 /* Keyboard hooks.  */
 extern void setup_w32_kbdhook (void);
 extern void remove_w32_kbdhook (void);
 extern int check_w32_winkey_state (int);
 #define w32_kbdhook_active (os_subtype != OS_9X)
+#else
+#define w32_kbdhook_active 0
+#endif
 
 /* Keypad command key support.  W32 doesn't have virtual keys defined
    for the function keys on the keypad (they are mapped to the standard