emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115821: Minor fixes for MinGW64 build.


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r115821: Minor fixes for MinGW64 build.
Date: Tue, 31 Dec 2013 16:03:04 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115821
revision-id: address@hidden
parent: address@hidden
author: Fabrice Popineau <address@hidden>
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Tue 2013-12-31 18:01:34 +0200
message:
  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.
modified:
  ChangeLog                      changelog-20091113204419-o5vbwnq5f7feedwu-1538
  configure.ac                   
configure.in-20091113204419-o5vbwnq5f7feedwu-783
  nt/ChangeLog                   changelog-20091113204419-o5vbwnq5f7feedwu-1545
  nt/inc/ms-w32.h                msw32.h-20091113204419-o5vbwnq5f7feedwu-807
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/lisp.h                     lisp.h-20091113204419-o5vbwnq5f7feedwu-253
  src/w32heap.c                  w32heap.c-20091113204419-o5vbwnq5f7feedwu-810
  src/w32proc.c                  w32proc.c-20091113204419-o5vbwnq5f7feedwu-814
  src/w32term.c                  w32term.c-20091113204419-o5vbwnq5f7feedwu-950
=== modified file 'ChangeLog'
--- a/ChangeLog 2013-12-29 13:17:09 +0000
+++ b/ChangeLog 2013-12-31 16:01:34 +0000
@@ -1,3 +1,8 @@
+2013-12-31  Fabrice Popineau  <address@hidden>
+
+       * configure.ac (canonical, C_SWITCH_SYSTEM): Support a 64-bit
+       MinGW64 build on MS-Windows.
+
 2013-12-29  Jan Djärv  <address@hidden>
 
        * configure.ac (xcsdkdir): Only set if using xcrun.

=== modified file 'configure.ac'
--- a/configure.ac      2013-12-29 13:17:09 +0000
+++ b/configure.ac      2013-12-31 16:01:34 +0000
@@ -622,6 +622,18 @@
     esac
   ;;
 
+  # MinGW64
+  x86_64-*-* )
+    case "${canonical}" in
+      *-mingw32 )
+               opsys=mingw32
+               # MinGW overrides and adds some system headers in nt/inc.
+               GCC_TEST_OPTIONS="-I $srcdir/nt/inc"
+               ;;
+      ## Otherwise, we'll fall through to the generic opsys code at the bottom.
+    esac
+  ;;
+
   * )
     unported=yes
   ;;
@@ -1215,7 +1227,12 @@
 ## additional optimization.  address@hidden
 test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \
   C_SWITCH_SYSTEM="-ma -qmaxmem=4000"
-test "$opsys" = "mingw32" && C_SWITCH_SYSTEM="-mtune=pentium4"
+if test "$opsys" = "mingw32"; then
+  case "$canonical" in
+    x86_64-*-mingw32) C_SWITCH_SYSTEM="-mtune=generic" ;;
+    *) C_SWITCH_SYSTEM="-mtune=pentium4" ;;
+  esac
+fi
 ## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
 ## It is redundant in glibc2, since we define _GNU_SOURCE.
 AC_SUBST(C_SWITCH_SYSTEM)
@@ -4802,7 +4819,7 @@
    ## pass a different -entry switch to linker.  FIXME: It is better
    ## to make the entry points the same by changing unexw32.c.
    case "$canonical" in
-     x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 
-Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,_start 
-Wl,-Map,./temacs.map" ;;
+     x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 
-Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start 
-Wl,-Map,./temacs.map" ;;
      *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 
-Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;;
    esac
    ;;

=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2013-12-30 17:51:28 +0000
+++ b/nt/ChangeLog      2013-12-31 16:01:34 +0000
@@ -1,3 +1,7 @@
+2013-12-31  Fabrice Popineau  <address@hidden>
+
+       * inc/ms-w32.h (sys_kill): Fix prototype.
+
 2013-12-30  Eli Zaretskii  <address@hidden>
 
        * inc/ms-w32.h (umask) [emacs]: Redirect to sys_umask.  (Bug#16299)

=== modified file 'nt/inc/ms-w32.h'
--- a/nt/inc/ms-w32.h   2013-12-30 17:51:28 +0000
+++ b/nt/inc/ms-w32.h   2013-12-31 16:01:34 +0000
@@ -394,7 +394,7 @@
 extern int sigaction (int, const struct sigaction *, struct sigaction *);
 extern int alarm (int);
 
-extern int sys_kill (int, int);
+extern int sys_kill (pid_t, int);
 
 
 /* For integration with MSDOS support.  */

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-12-31 15:00:43 +0000
+++ b/src/ChangeLog     2013-12-31 16:01:34 +0000
@@ -1,5 +1,17 @@
 2013-12-31  Fabrice Popineau  <address@hidden>
 
+       * w32term.c (w32_initialize): Use LCID and LOWORD.
+
+       * 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.
+
+       * w32heap.c (allocate_heap) [_WIN64]: Use "ull", not "i64", which
+       MinGW64 doesn't support.
+
+       * lisp.h (EMACS_INT) [_WIN64]: Define for the MinGW64 build.
+
        * w32.c (set_named_security_info): New function.
        (acl_set_file): Fall back on set_named_security_info if
        set_file_security fails.

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2013-12-18 20:36:50 +0000
+++ b/src/lisp.h        2013-12-31 16:01:34 +0000
@@ -62,7 +62,7 @@
    pI - printf length modifier for EMACS_INT
    EMACS_UINT - unsigned variant of EMACS_INT */
 #ifndef EMACS_INT_MAX
-# if LONG_MAX < LLONG_MAX && defined WIDE_EMACS_INT
+# if LONG_MAX < LLONG_MAX && (defined(WIDE_EMACS_INT) || defined(_WIN64))
 typedef long long int EMACS_INT;
 typedef unsigned long long int EMACS_UINT;
 #  define EMACS_INT_MAX LLONG_MAX

=== modified file 'src/w32heap.c'
--- a/src/w32heap.c     2013-01-22 13:30:17 +0000
+++ b/src/w32heap.c     2013-12-31 16:01:34 +0000
@@ -78,7 +78,7 @@
   while (!ptr && (base < end))
     {
 #ifdef _WIN64
-      reserved_heap_size = min(end - base, 0x4000000000i64); /* Limit to 256Gb 
*/
+      reserved_heap_size = min(end - base, 0x4000000000ull); /* Limit to 256Gb 
*/
 #else
       reserved_heap_size = end - base;
 #endif
@@ -96,7 +96,7 @@
 allocate_heap (void)
 {
 #ifdef _WIN64
-  size_t size = 0x4000000000i64; /* start by asking for 32GB */
+  size_t size = 0x4000000000ull; /* start by asking for 32GB */
 #else
   /* We used to start with 2GB here, but on Windows 7 that would leave
      too little room in the address space for threads started by

=== modified file 'src/w32proc.c'
--- a/src/w32proc.c     2013-12-18 03:21:48 +0000
+++ b/src/w32proc.c     2013-12-31 16:01:34 +0000
@@ -43,8 +43,9 @@
 #undef kill
 
 #include <windows.h>
-#ifdef __GNUC__
-/* This definition is missing from mingw32 headers. */
+#if defined(__GNUC__) && !defined(__MINGW64__)
+/* This definition is missing from mingw.org headers, but not MinGW64
+   headers. */
 extern BOOL WINAPI IsValidLocale (LCID, DWORD);
 #endif
 
@@ -1066,7 +1067,7 @@
 
 static BOOL
 create_child (char *exe, char *cmdline, char *env, int is_gui_app,
-             int * pPid, child_process *cp)
+             pid_t * pPid, child_process *cp)
 {
   STARTUPINFO start;
   SECURITY_ATTRIBUTES sec_attrs;
@@ -3084,10 +3085,10 @@
     {
       while (--num_layouts >= 0)
        {
-         DWORD kl = (DWORD) layouts[num_layouts];
+         HKL kl = layouts[num_layouts];
 
-         obj = Fcons (Fcons (make_number (kl & 0xffff),
-                             make_number ((kl >> 16) & 0xffff)),
+         obj = Fcons (Fcons (make_number (LOWORD (kl)),
+                             make_number (HIWORD (kl))),
                       obj);
        }
     }
@@ -3102,10 +3103,10 @@
 The return value is the cons of the language id and the layout id.  */)
   (void)
 {
-  DWORD kl = (DWORD) GetKeyboardLayout (dwWindowsThreadId);
+  HKL kl = GetKeyboardLayout (dwWindowsThreadId);
 
-  return Fcons (make_number (kl & 0xffff),
-               make_number ((kl >> 16) & 0xffff));
+  return Fcons (make_number (LOWORD (kl)),
+               make_number (HIWORD (kl)));
 }
 
 
@@ -3116,14 +3117,14 @@
 If successful, the new layout id is returned, otherwise nil.  */)
   (Lisp_Object layout)
 {
-  DWORD kl;
+  HKL kl;
 
   CHECK_CONS (layout);
   CHECK_NUMBER_CAR (layout);
   CHECK_NUMBER_CDR (layout);
 
-  kl = (XINT (XCAR (layout)) & 0xffff)
-    | (XINT (XCDR (layout)) << 16);
+ kl = (HKL) ((XINT (XCAR (layout)) & 0xffff)
+            | (XINT (XCDR (layout)) << 16));
 
   /* Synchronize layout with input thread.  */
   if (dwWindowsThreadId)
@@ -3138,7 +3139,7 @@
            return Qnil;
        }
     }
-  else if (!ActivateKeyboardLayout ((HKL) kl, 0))
+  else if (!ActivateKeyboardLayout (kl, 0))
     return Qnil;
 
   return Fw32_get_keyboard_layout ();

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2013-12-21 07:04:07 +0000
+++ b/src/w32term.c     2013-12-31 16:01:34 +0000
@@ -6410,9 +6410,8 @@
   Fset_input_mode (Qnil, Qnil, make_number (2), Qnil);
 
   {
-    DWORD input_locale_id = ((DWORD_PTR) GetKeyboardLayout (0) & 0xffffffff);
-    w32_keyboard_codepage =
-      codepage_for_locale ((LCID) (input_locale_id & 0xffff));
+    LCID input_locale_id = LOWORD (GetKeyboardLayout (0));
+    w32_keyboard_codepage = codepage_for_locale (input_locale_id);
   }
 
   /* Create the window thread - it will terminate itself when the app


reply via email to

[Prev in Thread] Current Thread [Next in Thread]