diff options
| author | Ken Brown | 2016-03-06 12:08:39 -0500 |
|---|---|---|
| committer | Ken Brown | 2016-03-06 12:08:39 -0500 |
| commit | 258f1034d7f451da1c05ef246ca0849d0c0a9c3c (patch) | |
| tree | 6d0e9b7b535c5aa8cb342bcf55f33b087f01c13a /src | |
| parent | 69e03ddccf47fc29126317dd3317313ecd92b797 (diff) | |
| download | emacs-258f1034d7f451da1c05ef246ca0849d0c0a9c3c.tar.gz emacs-258f1034d7f451da1c05ef246ca0849d0c0a9c3c.zip | |
Fix Cygwin-w32 build
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 6 | ||||
| -rw-r--r-- | src/w32term.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 10c8af71073..0fe6a6fd2b3 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -2112,6 +2112,7 @@ my_post_msg (W32Msg * wmsg, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |||
| 2112 | post_msg (wmsg); | 2112 | post_msg (wmsg); |
| 2113 | } | 2113 | } |
| 2114 | 2114 | ||
| 2115 | #ifdef WINDOWSNT | ||
| 2115 | /* The Windows keyboard hook callback. */ | 2116 | /* The Windows keyboard hook callback. */ |
| 2116 | static LRESULT CALLBACK | 2117 | static LRESULT CALLBACK |
| 2117 | funhook (int code, WPARAM w, LPARAM l) | 2118 | funhook (int code, WPARAM w, LPARAM l) |
| @@ -2370,6 +2371,7 @@ remove_w32_kbdhook (void) | |||
| 2370 | kbdhook.hook = NULL; | 2371 | kbdhook.hook = NULL; |
| 2371 | } | 2372 | } |
| 2372 | } | 2373 | } |
| 2374 | #endif /* WINDOWSNT */ | ||
| 2373 | 2375 | ||
| 2374 | /* Mark a specific key combination as hooked, preventing it to be | 2376 | /* Mark a specific key combination as hooked, preventing it to be |
| 2375 | handled by the system. */ | 2377 | handled by the system. */ |
| @@ -4734,12 +4736,16 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |||
| 4734 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | 4736 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |
| 4735 | goto dflt; | 4737 | goto dflt; |
| 4736 | 4738 | ||
| 4739 | #ifdef WINDOWSNT | ||
| 4737 | case WM_CREATE: | 4740 | case WM_CREATE: |
| 4738 | setup_w32_kbdhook (); | 4741 | setup_w32_kbdhook (); |
| 4739 | goto dflt; | 4742 | goto dflt; |
| 4743 | #endif | ||
| 4740 | 4744 | ||
| 4741 | case WM_DESTROY: | 4745 | case WM_DESTROY: |
| 4746 | #ifdef WINDOWSNT | ||
| 4742 | remove_w32_kbdhook (); | 4747 | remove_w32_kbdhook (); |
| 4748 | #endif | ||
| 4743 | CoUninitialize (); | 4749 | CoUninitialize (); |
| 4744 | return 0; | 4750 | return 0; |
| 4745 | 4751 | ||
diff --git a/src/w32term.h b/src/w32term.h index aed89d8c254..7c23bc43a1f 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -738,11 +738,15 @@ extern int handle_file_notifications (struct input_event *); | |||
| 738 | extern void w32_initialize_display_info (Lisp_Object); | 738 | extern void w32_initialize_display_info (Lisp_Object); |
| 739 | extern void initialize_w32_display (struct terminal *, int *, int *); | 739 | extern void initialize_w32_display (struct terminal *, int *, int *); |
| 740 | 740 | ||
| 741 | #ifdef WINDOWSNT | ||
| 741 | /* Keyboard hooks. */ | 742 | /* Keyboard hooks. */ |
| 742 | extern void setup_w32_kbdhook (void); | 743 | extern void setup_w32_kbdhook (void); |
| 743 | extern void remove_w32_kbdhook (void); | 744 | extern void remove_w32_kbdhook (void); |
| 744 | extern int check_w32_winkey_state (int); | 745 | extern int check_w32_winkey_state (int); |
| 745 | #define w32_kbdhook_active (os_subtype != OS_9X) | 746 | #define w32_kbdhook_active (os_subtype != OS_9X) |
| 747 | #else | ||
| 748 | #define w32_kbdhook_active 0 | ||
| 749 | #endif | ||
| 746 | 750 | ||
| 747 | /* Keypad command key support. W32 doesn't have virtual keys defined | 751 | /* Keypad command key support. W32 doesn't have virtual keys defined |
| 748 | for the function keys on the keypad (they are mapped to the standard | 752 | for the function keys on the keypad (they are mapped to the standard |