diff options
| author | Fabrice Popineau | 2013-12-31 18:01:34 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-12-31 18:01:34 +0200 |
| commit | bd717ca4f4c25e45dcb3b894323fd608ae278922 (patch) | |
| tree | b61f9c9c54d45cd408bf2c8e1198db3e84172bec | |
| parent | 535f0fbd00ab0cdb65c09270ea8df03f9528f127 (diff) | |
| download | emacs-bd717ca4f4c25e45dcb3b894323fd608ae278922.tar.gz emacs-bd717ca4f4c25e45dcb3b894323fd608ae278922.zip | |
Minor fixes for MinGW64 build.
configure.ac (canonical, C_SWITCH_SYSTEM): Support a 64-bit
MinGW64 build on MS-Windows.
nt/inc/ms-w32.h (sys_kill): Fix prototype.
src/w32term.c (w32_initialize): Use LCID and LOWORD.
src/w32proc.c (create_child): Use pid_t for 5th argument.
(IsValidLocale): Don't provide prototype for MinGW64.
(Fw32_get_valid_keyboard_layouts, Fw32_get_keyboard_layout)
(Fw32_set_keyboard_layout): Use HKL and HIWORD/LOWORD.
src/w32heap.c (allocate_heap) [_WIN64]: Use "ull", not "i64", which
MinGW64 doesn't support.
src/lisp.h (EMACS_INT) [_WIN64]: Define for the MinGW64 build.
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | configure.ac | 21 | ||||
| -rw-r--r-- | nt/ChangeLog | 4 | ||||
| -rw-r--r-- | nt/inc/ms-w32.h | 2 | ||||
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/w32heap.c | 4 | ||||
| -rw-r--r-- | src/w32proc.c | 27 | ||||
| -rw-r--r-- | src/w32term.c | 5 |
9 files changed, 60 insertions, 22 deletions
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-12-31 Fabrice Popineau <fabrice.popineau@supelec.fr> | ||
| 2 | |||
| 3 | * configure.ac (canonical, C_SWITCH_SYSTEM): Support a 64-bit | ||
| 4 | MinGW64 build on MS-Windows. | ||
| 5 | |||
| 1 | 2013-12-29 Jan Djärv <jan.h.d@swipnet.se> | 6 | 2013-12-29 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 7 | ||
| 3 | * configure.ac (xcsdkdir): Only set if using xcrun. | 8 | * configure.ac (xcsdkdir): Only set if using xcrun. |
diff --git a/configure.ac b/configure.ac index 059f04b3eda..f0b1358300e 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -622,6 +622,18 @@ case "${canonical}" in | |||
| 622 | esac | 622 | esac |
| 623 | ;; | 623 | ;; |
| 624 | 624 | ||
| 625 | # MinGW64 | ||
| 626 | x86_64-*-* ) | ||
| 627 | case "${canonical}" in | ||
| 628 | *-mingw32 ) | ||
| 629 | opsys=mingw32 | ||
| 630 | # MinGW overrides and adds some system headers in nt/inc. | ||
| 631 | GCC_TEST_OPTIONS="-I $srcdir/nt/inc" | ||
| 632 | ;; | ||
| 633 | ## Otherwise, we'll fall through to the generic opsys code at the bottom. | ||
| 634 | esac | ||
| 635 | ;; | ||
| 636 | |||
| 625 | * ) | 637 | * ) |
| 626 | unported=yes | 638 | unported=yes |
| 627 | ;; | 639 | ;; |
| @@ -1215,7 +1227,12 @@ C_SWITCH_SYSTEM= | |||
| 1215 | ## additional optimization. --nils@exp-math.uni-essen.de | 1227 | ## additional optimization. --nils@exp-math.uni-essen.de |
| 1216 | test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \ | 1228 | test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \ |
| 1217 | C_SWITCH_SYSTEM="-ma -qmaxmem=4000" | 1229 | C_SWITCH_SYSTEM="-ma -qmaxmem=4000" |
| 1218 | test "$opsys" = "mingw32" && C_SWITCH_SYSTEM="-mtune=pentium4" | 1230 | if test "$opsys" = "mingw32"; then |
| 1231 | case "$canonical" in | ||
| 1232 | x86_64-*-mingw32) C_SWITCH_SYSTEM="-mtune=generic" ;; | ||
| 1233 | *) C_SWITCH_SYSTEM="-mtune=pentium4" ;; | ||
| 1234 | esac | ||
| 1235 | fi | ||
| 1219 | ## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. | 1236 | ## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. |
| 1220 | ## It is redundant in glibc2, since we define _GNU_SOURCE. | 1237 | ## It is redundant in glibc2, since we define _GNU_SOURCE. |
| 1221 | AC_SUBST(C_SWITCH_SYSTEM) | 1238 | AC_SUBST(C_SWITCH_SYSTEM) |
| @@ -4802,7 +4819,7 @@ case "$opsys" in | |||
| 4802 | ## pass a different -entry switch to linker. FIXME: It is better | 4819 | ## pass a different -entry switch to linker. FIXME: It is better |
| 4803 | ## to make the entry points the same by changing unexw32.c. | 4820 | ## to make the entry points the same by changing unexw32.c. |
| 4804 | case "$canonical" in | 4821 | case "$canonical" in |
| 4805 | x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,_start -Wl,-Map,./temacs.map" ;; | 4822 | x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;; |
| 4806 | *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;; | 4823 | *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;; |
| 4807 | esac | 4824 | esac |
| 4808 | ;; | 4825 | ;; |
diff --git a/nt/ChangeLog b/nt/ChangeLog index 8eb601d4e3e..8083fc59473 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-12-31 Fabrice Popineau <fabrice.popineau@supelec.fr> | ||
| 2 | |||
| 3 | * inc/ms-w32.h (sys_kill): Fix prototype. | ||
| 4 | |||
| 1 | 2013-12-30 Eli Zaretskii <eliz@gnu.org> | 5 | 2013-12-30 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * inc/ms-w32.h (umask) [emacs]: Redirect to sys_umask. (Bug#16299) | 7 | * inc/ms-w32.h (umask) [emacs]: Redirect to sys_umask. (Bug#16299) |
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index 735f9a65320..aa7690ca0fa 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h | |||
| @@ -394,7 +394,7 @@ extern int setpgrp (int, int); | |||
| 394 | extern int sigaction (int, const struct sigaction *, struct sigaction *); | 394 | extern int sigaction (int, const struct sigaction *, struct sigaction *); |
| 395 | extern int alarm (int); | 395 | extern int alarm (int); |
| 396 | 396 | ||
| 397 | extern int sys_kill (int, int); | 397 | extern int sys_kill (pid_t, int); |
| 398 | 398 | ||
| 399 | 399 | ||
| 400 | /* For integration with MSDOS support. */ | 400 | /* For integration with MSDOS support. */ |
diff --git a/src/ChangeLog b/src/ChangeLog index 356d0b7bbf5..d17191df9d0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,17 @@ | |||
| 1 | 2013-12-31 Fabrice Popineau <fabrice.popineau@supelec.fr> | 1 | 2013-12-31 Fabrice Popineau <fabrice.popineau@supelec.fr> |
| 2 | 2 | ||
| 3 | * w32term.c (w32_initialize): Use LCID and LOWORD. | ||
| 4 | |||
| 5 | * w32proc.c (create_child): Use pid_t for 5th argument. | ||
| 6 | (IsValidLocale): Don't provide prototype for MinGW64. | ||
| 7 | (Fw32_get_valid_keyboard_layouts, Fw32_get_keyboard_layout) | ||
| 8 | (Fw32_set_keyboard_layout): Use HKL and HIWORD/LOWORD. | ||
| 9 | |||
| 10 | * w32heap.c (allocate_heap) [_WIN64]: Use "ull", not "i64", which | ||
| 11 | MinGW64 doesn't support. | ||
| 12 | |||
| 13 | * lisp.h (EMACS_INT) [_WIN64]: Define for the MinGW64 build. | ||
| 14 | |||
| 3 | * w32.c (set_named_security_info): New function. | 15 | * w32.c (set_named_security_info): New function. |
| 4 | (acl_set_file): Fall back on set_named_security_info if | 16 | (acl_set_file): Fall back on set_named_security_info if |
| 5 | set_file_security fails. | 17 | set_file_security fails. |
diff --git a/src/lisp.h b/src/lisp.h index bb1c38e1bf6..0ae0e607253 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -62,7 +62,7 @@ INLINE_HEADER_BEGIN | |||
| 62 | pI - printf length modifier for EMACS_INT | 62 | pI - printf length modifier for EMACS_INT |
| 63 | EMACS_UINT - unsigned variant of EMACS_INT */ | 63 | EMACS_UINT - unsigned variant of EMACS_INT */ |
| 64 | #ifndef EMACS_INT_MAX | 64 | #ifndef EMACS_INT_MAX |
| 65 | # if LONG_MAX < LLONG_MAX && defined WIDE_EMACS_INT | 65 | # if LONG_MAX < LLONG_MAX && (defined(WIDE_EMACS_INT) || defined(_WIN64)) |
| 66 | typedef long long int EMACS_INT; | 66 | typedef long long int EMACS_INT; |
| 67 | typedef unsigned long long int EMACS_UINT; | 67 | typedef unsigned long long int EMACS_UINT; |
| 68 | # define EMACS_INT_MAX LLONG_MAX | 68 | # define EMACS_INT_MAX LLONG_MAX |
diff --git a/src/w32heap.c b/src/w32heap.c index 81206ce2834..405eccf75f2 100644 --- a/src/w32heap.c +++ b/src/w32heap.c | |||
| @@ -78,7 +78,7 @@ allocate_heap (void) | |||
| 78 | while (!ptr && (base < end)) | 78 | while (!ptr && (base < end)) |
| 79 | { | 79 | { |
| 80 | #ifdef _WIN64 | 80 | #ifdef _WIN64 |
| 81 | reserved_heap_size = min(end - base, 0x4000000000i64); /* Limit to 256Gb */ | 81 | reserved_heap_size = min(end - base, 0x4000000000ull); /* Limit to 256Gb */ |
| 82 | #else | 82 | #else |
| 83 | reserved_heap_size = end - base; | 83 | reserved_heap_size = end - base; |
| 84 | #endif | 84 | #endif |
| @@ -96,7 +96,7 @@ static char * | |||
| 96 | allocate_heap (void) | 96 | allocate_heap (void) |
| 97 | { | 97 | { |
| 98 | #ifdef _WIN64 | 98 | #ifdef _WIN64 |
| 99 | size_t size = 0x4000000000i64; /* start by asking for 32GB */ | 99 | size_t size = 0x4000000000ull; /* start by asking for 32GB */ |
| 100 | #else | 100 | #else |
| 101 | /* We used to start with 2GB here, but on Windows 7 that would leave | 101 | /* We used to start with 2GB here, but on Windows 7 that would leave |
| 102 | too little room in the address space for threads started by | 102 | too little room in the address space for threads started by |
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 (); |
diff --git a/src/w32term.c b/src/w32term.c index 583e0ebaf31..1753a9ffc9d 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -6410,9 +6410,8 @@ w32_initialize (void) | |||
| 6410 | Fset_input_mode (Qnil, Qnil, make_number (2), Qnil); | 6410 | Fset_input_mode (Qnil, Qnil, make_number (2), Qnil); |
| 6411 | 6411 | ||
| 6412 | { | 6412 | { |
| 6413 | DWORD input_locale_id = ((DWORD_PTR) GetKeyboardLayout (0) & 0xffffffff); | 6413 | LCID input_locale_id = LOWORD (GetKeyboardLayout (0)); |
| 6414 | w32_keyboard_codepage = | 6414 | w32_keyboard_codepage = codepage_for_locale (input_locale_id); |
| 6415 | codepage_for_locale ((LCID) (input_locale_id & 0xffff)); | ||
| 6416 | } | 6415 | } |
| 6417 | 6416 | ||
| 6418 | /* Create the window thread - it will terminate itself when the app | 6417 | /* Create the window thread - it will terminate itself when the app |