diff options
Diffstat (limited to 'src/w32proc.c')
| -rw-r--r-- | src/w32proc.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/w32proc.c b/src/w32proc.c index 2b583efba56..aecf3e5a24f 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -43,8 +43,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 43 | #undef kill | 43 | #undef kill |
| 44 | 44 | ||
| 45 | #include <windows.h> | 45 | #include <windows.h> |
| 46 | #ifdef __GNUC__ | 46 | #if defined(__GNUC__) && !defined(__MINGW64__) |
| 47 | /* This definition is missing from mingw32 headers. */ | 47 | /* This definition is missing from mingw.org headers, but not MinGW64 |
| 48 | headers. */ | ||
| 48 | extern BOOL WINAPI IsValidLocale (LCID, DWORD); | 49 | extern BOOL WINAPI IsValidLocale (LCID, DWORD); |
| 49 | #endif | 50 | #endif |
| 50 | 51 | ||
| @@ -1066,7 +1067,7 @@ static char * process_dir; | |||
| 1066 | 1067 | ||
| 1067 | static BOOL | 1068 | static BOOL |
| 1068 | create_child (char *exe, char *cmdline, char *env, int is_gui_app, | 1069 | create_child (char *exe, char *cmdline, char *env, int is_gui_app, |
| 1069 | int * pPid, child_process *cp) | 1070 | pid_t * pPid, child_process *cp) |
| 1070 | { | 1071 | { |
| 1071 | STARTUPINFO start; | 1072 | STARTUPINFO start; |
| 1072 | SECURITY_ATTRIBUTES sec_attrs; | 1073 | SECURITY_ATTRIBUTES sec_attrs; |
| @@ -3084,10 +3085,10 @@ The return value is a list of pairs of language id and layout id. */) | |||
| 3084 | { | 3085 | { |
| 3085 | while (--num_layouts >= 0) | 3086 | while (--num_layouts >= 0) |
| 3086 | { | 3087 | { |
| 3087 | DWORD kl = (DWORD) layouts[num_layouts]; | 3088 | HKL kl = layouts[num_layouts]; |
| 3088 | 3089 | ||
| 3089 | obj = Fcons (Fcons (make_number (kl & 0xffff), | 3090 | obj = Fcons (Fcons (make_number (LOWORD (kl)), |
| 3090 | make_number ((kl >> 16) & 0xffff)), | 3091 | make_number (HIWORD (kl))), |
| 3091 | obj); | 3092 | obj); |
| 3092 | } | 3093 | } |
| 3093 | } | 3094 | } |
| @@ -3102,10 +3103,10 @@ DEFUN ("w32-get-keyboard-layout", Fw32_get_keyboard_layout, | |||
| 3102 | The return value is the cons of the language id and the layout id. */) | 3103 | The return value is the cons of the language id and the layout id. */) |
| 3103 | (void) | 3104 | (void) |
| 3104 | { | 3105 | { |
| 3105 | DWORD kl = (DWORD) GetKeyboardLayout (dwWindowsThreadId); | 3106 | HKL kl = GetKeyboardLayout (dwWindowsThreadId); |
| 3106 | 3107 | ||
| 3107 | return Fcons (make_number (kl & 0xffff), | 3108 | return Fcons (make_number (LOWORD (kl)), |
| 3108 | make_number ((kl >> 16) & 0xffff)); | 3109 | make_number (HIWORD (kl))); |
| 3109 | } | 3110 | } |
| 3110 | 3111 | ||
| 3111 | 3112 | ||
| @@ -3116,14 +3117,14 @@ The keyboard layout setting affects interpretation of keyboard input. | |||
| 3116 | If successful, the new layout id is returned, otherwise nil. */) | 3117 | If successful, the new layout id is returned, otherwise nil. */) |
| 3117 | (Lisp_Object layout) | 3118 | (Lisp_Object layout) |
| 3118 | { | 3119 | { |
| 3119 | DWORD kl; | 3120 | HKL kl; |
| 3120 | 3121 | ||
| 3121 | CHECK_CONS (layout); | 3122 | CHECK_CONS (layout); |
| 3122 | CHECK_NUMBER_CAR (layout); | 3123 | CHECK_NUMBER_CAR (layout); |
| 3123 | CHECK_NUMBER_CDR (layout); | 3124 | CHECK_NUMBER_CDR (layout); |
| 3124 | 3125 | ||
| 3125 | kl = (XINT (XCAR (layout)) & 0xffff) | 3126 | kl = (HKL) ((XINT (XCAR (layout)) & 0xffff) |
| 3126 | | (XINT (XCDR (layout)) << 16); | 3127 | | (XINT (XCDR (layout)) << 16)); |
| 3127 | 3128 | ||
| 3128 | /* Synchronize layout with input thread. */ | 3129 | /* Synchronize layout with input thread. */ |
| 3129 | if (dwWindowsThreadId) | 3130 | if (dwWindowsThreadId) |
| @@ -3138,7 +3139,7 @@ If successful, the new layout id is returned, otherwise nil. */) | |||
| 3138 | return Qnil; | 3139 | return Qnil; |
| 3139 | } | 3140 | } |
| 3140 | } | 3141 | } |
| 3141 | else if (!ActivateKeyboardLayout ((HKL) kl, 0)) | 3142 | else if (!ActivateKeyboardLayout (kl, 0)) |
| 3142 | return Qnil; | 3143 | return Qnil; |
| 3143 | 3144 | ||
| 3144 | return Fw32_get_keyboard_layout (); | 3145 | return Fw32_get_keyboard_layout (); |