emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r106292: Support MSVC build with newe


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106292: Support MSVC build with newer versions of Visual Studio.
Date: Sat, 05 Nov 2011 13:34:56 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106292
fixes bug(s): http://debbugs.gnu.org/9960
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2011-11-05 13:34:56 +0200
message:
  Support MSVC build with newer versions of Visual Studio.
  
  Small portions of the changes by Fabrice Popineau <address@hidden>.
  
   src/makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
   Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
   nt/gmake.defs.
   src/lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
   which are not supported by MSVC.
   (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
   (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
   bitfields.
   (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
   types in bitfields.
   (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
   src/w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
   src/w32.c: Don't include w32api.h for MSVC.
   (init_environment) [_MSC_VER]: Call sys_access, not _access.
   src/s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
   [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
   (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
   (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
   e_* cousins.
   (alloca) [_MSC_VER]: Define to _alloca.
   src/lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
   src/regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
   nt/makefile.w32-in (clean-other-dirs-nmake)
   (distclean-other-dirs-nmake, maintainer-clean-other-dirs-nmake):
   Update for current structure of doc/ subdirectories.
   nt/gmake.defs (OBJ0_c, OBJ1_c, OBJ2_c): New variables.
   nt/INSTALL: Update for newer versions of MSVC.
   lib/makefile.w32-in (FRC): New dummy target.
   (TAGS): Depend on FRC.
modified:
  ChangeLog
  lib/makefile.w32-in
  nt/ChangeLog
  nt/INSTALL
  nt/gmake.defs
  nt/makefile.w32-in
  nt/nmake.defs
  src/ChangeLog
  src/lisp.h
  src/makefile.w32-in
  src/regex.c
  src/s/ms-w32.h
  src/w32.c
  src/w32fns.c
=== modified file 'ChangeLog'
--- a/ChangeLog 2011-11-04 22:16:46 +0000
+++ b/ChangeLog 2011-11-05 11:34:56 +0000
@@ -1,3 +1,8 @@
+2011-11-05  Eli Zaretskii  <address@hidden>
+
+       * lib/makefile.w32-in (FRC): New dummy target.
+       (TAGS): Depend on FRC.
+
 2011-11-04  Glenn Morris  <address@hidden>
 
        * configure.in: Increase minimum GnuTLS version to 2.6.6. (Bug#9929)

=== modified file 'lib/makefile.w32-in'
--- a/lib/makefile.w32-in       2011-07-24 22:15:47 +0000
+++ b/lib/makefile.w32-in       2011-11-05 11:34:56 +0000
@@ -50,7 +50,9 @@
 
 ### TAGS ###
 
-TAGS:
+FRC:
+
+TAGS: FRC
         ../lib-src/$(BLD)/etags.exe *.c *.h
 
 ### DEPENDENCIES ###

=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2011-11-04 21:59:16 +0000
+++ b/nt/ChangeLog      2011-11-05 11:34:56 +0000
@@ -1,3 +1,21 @@
+2011-11-05  Eli Zaretskii  <address@hidden>
+
+       Support MSVC build with newer versions of Visual Studio.
+       * makefile.w32-in (clean-other-dirs-nmake)
+       (distclean-other-dirs-nmake, maintainer-clean-other-dirs-nmake):
+       Update for current structure of doc/ subdirectories.
+
+       * gmake.defs (OBJ0_c, OBJ1_c, OBJ2_c): New variables.
+
+       * INSTALL: Update for newer versions of MSVC.
+
+2011-11-05  Fabrice Popineau  <address@hidden> (tiny change)
+
+       Support MSVC build with newer versions of Visual Studio.
+       * nmake.defs (USE_CRT_DLL): Define to 1.
+       (libc, EMACS_EXTRA_C_FLAGS, SYS_LDFLAGS, ARCH_CFLAGS): Update values.
+       (D): New variable.
+
 2011-11-04  Eli Zaretskii  <address@hidden>
 
        * runemacs.c (ensure_unicows_dll): New function, tries to load

=== modified file 'nt/INSTALL'
--- a/nt/INSTALL        2011-10-25 02:33:24 +0000
+++ b/nt/INSTALL        2011-11-05 11:34:56 +0000
@@ -21,19 +21,32 @@
 
        cd nt
 
-  2. Run configure.bat.  From the COMMAND.COM/CMD.EXE command prompt:
+  2. Run configure.bat.
+
+  2a.If you use MSVC, set up the build environment by running the
+     SetEnv.cmd batch file from the appropriate SDK directory.  (Skip
+     this step if you are using MinGW.)  For example:
+
+       "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 
/Debug
+
+      if you are goiung to compile a debug version, or
+
+       "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 
/Release
+
+      if you are going to compile an optimized version.
+
+  2b.From the COMMAND.COM/CMD.EXE command prompt type:
 
        configure
 
-     from a Unixy shell prompt:
+     From a Unixy shell prompt:
 
        cmd /c configure.bat
      or
        command.com /c configure.bat
 
   3. Run the Make utility suitable for your environment.  If you build
-     with the Microsoft's Visual C compiler (but see notes about using
-     VC++ 8.0 and later below):
+     with the Microsoft's Visual C compiler:
 
        nmake
 
@@ -101,24 +114,21 @@
 * Supported development environments
 
   To compile Emacs, you will need either Microsoft Visual C++ 2.0, or
-  later up to 7.0, and nmake, or a Windows port of GCC 2.95 or later
-  with MinGW and W32 API support and a port of GNU Make.  You can use
-  the Cygwin ports of GCC, but Emacs requires the MinGW headers and
-  libraries to build (latest versions of the Cygwin toolkit, at least
-  since v1.3.3, include the MinGW headers and libraries as an integral
-  part).
-
-  Note that building Emacs with Visual Studio 2005 (VC++ 8.0) and
-  later is not supported at this time, due to changes introduced by
-  Microsoft into the libraries shipped with the compiler.
+  later and nmake, or a Windows port of GCC 2.95 or later with MinGW
+  and W32 API support and a port of GNU Make.  You can use the Cygwin
+  ports of GCC, but Emacs requires the MinGW headers and libraries to
+  build (latest versions of the Cygwin toolkit, at least since v1.3.3,
+  include the MinGW headers and libraries as an integral part).
 
   The rest of this file assumes you have a working development
-  environment.  If you just installed  such an environment, try
+  environment.  If you just installed such an environment, try
   building a trivial C "Hello world" program, and see if it works.  If
   it doesn't work, resolve that problem first!  If you use Microsoft
   Visual Studio .NET 2003, don't forget to run the VCVARS32.BAT batch
   file from the `Bin' subdirectory of the directory where you have
-  installed VS.NET.
+  installed VS.NET.  With other versions of MSVC, run the SetEnv.cmd
+  batch file from the `Bin' subdirectory of the directory where you
+  have the SDK installed.
 
   If you use the MinGW port of GCC and GNU Make to build Emacs, there
   are some compatibility issues wrt Make and the shell that is run by

=== modified file 'nt/gmake.defs'
--- a/nt/gmake.defs     2011-05-07 04:00:12 +0000
+++ b/nt/gmake.defs     2011-11-05 11:34:56 +0000
@@ -193,6 +193,11 @@
 UNISCRIBE      = -lusp10
 UUID           = -luuid
 
+# Used by src/makefile.w32-in, since Nmake barfs on $(func SOMETHING)
+OBJ0_c         = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0))
+OBJ1_c         = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1))
+OBJ2_c         = $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2))
+
 ifdef NOOPT
 DEBUG_CFLAGS   = -DEMACSDEBUG
 else

=== modified file 'nt/makefile.w32-in'
--- a/nt/makefile.w32-in        2011-10-31 02:25:01 +0000
+++ b/nt/makefile.w32-in        2011-11-05 11:34:56 +0000
@@ -313,15 +313,15 @@
        $(MAKE) $(MFLAGS) clean
        cd ..\doc\lispintro
        $(MAKE) $(MFLAGS) clean
-       cd ..\doc\lispref
+       cd ..\lispref
        $(MAKE) $(MFLAGS) clean
-       cd ..\leim
+       cd ..\..\leim
        $(MAKE) $(MFLAGS) clean
        cd ..\doc\emacs
        $(MAKE) $(MFLAGS) clean
-       cd ..\doc\misc
+       cd ..\misc
        $(MAKE) $(MFLAGS) clean
-       cd ..\nt
+       cd ..\..\nt
 
 clean-other-dirs-gmake:
        $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean
@@ -381,13 +381,13 @@
        $(MAKE) $(MFLAGS) distclean
        cd ..\doc\emacs
        $(MAKE) $(MFLAGS) distclean
-       cd ..\doc\misc
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\doc\lispintro
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\doc\lispref
-       $(MAKE) $(MFLAGS) distclean
-       cd ..\nt
+       cd ..\misc
+       $(MAKE) $(MFLAGS) distclean
+       cd ..\lispintro
+       $(MAKE) $(MFLAGS) distclean
+       cd ..\lispref
+       $(MAKE) $(MFLAGS) distclean
+       cd ..\..\nt
 
 distclean-other-dirs-gmake:
        $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib distclean
@@ -415,13 +415,13 @@
        $(MAKE) $(MFLAGS) maintainer-clean
        cd ..\doc\emacs
        $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\doc\misc
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\doc\lispintro
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\doc\lispref
-       $(MAKE) $(MFLAGS) maintainer-clean
-       cd ..\nt
+       cd ..\misc
+       $(MAKE) $(MFLAGS) maintainer-clean
+       cd ..\lispintro
+       $(MAKE) $(MFLAGS) maintainer-clean
+       cd ..\lispref
+       $(MAKE) $(MFLAGS) maintainer-clean
+       cd ..\..\nt
 
 maintainer-clean-other-dirs-gmake:
        $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib maintainer-clean

=== modified file 'nt/nmake.defs'
--- a/nt/nmake.defs     2011-05-07 04:00:12 +0000
+++ b/nt/nmake.defs     2011-11-05 11:34:56 +0000
@@ -109,7 +109,15 @@
 RC_OUT         = -Fo
 RC_INCLUDE     = -i
 
-libc           = libc.lib
+USE_CRT_DLL    = 1
+
+!ifdef USE_CRT_DLL
+libc           = msvcrt$(D).lib
+EMACS_EXTRA_C_FLAGS= -D_DLL -D_MT -DUSE_CRT_DLL=1
+!else
+libc           = libcmt$(D).lib
+EMACS_EXTRA_C_FLAGS= -D_MT
+!endif
 baselibs       =
 O              = obj
 A              = lib
@@ -146,9 +154,13 @@
                  $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(USER_CFLAGS) 
$(LOCAL_FLAGS)
 ESC_CFLAGS      = -I. $(ARCH_CFLAGS) \
                  $(DEBUG_CFLAGS) $(CHECKING_CFLAGS) $(ESC_USER_CFLAGS) 
$(LOCAL_FLAGS)
-EMACS_EXTRA_C_FLAGS =
 
-SYS_LDFLAGS    = -nologo -release -incremental:no -version:3.10 -swaprun:cd 
-swaprun:net setargv.obj
+#SYS_LDFLAGS   = -nologo -release -incremental:no -version:3.10 -swaprun:cd 
-swaprun:net setargv.obj
+!ifdef NOOPT
+SYS_LDFLAGS    = -nologo -manifest -dynamicbase:no -debug -incremental:no 
-version:3.10 -swaprun:cd -swaprun:net setargv.obj
+!else
+SYS_LDFLAGS    = -nologo -manifest -dynamicbase:no -release -incremental:no 
-version:3.10 -swaprun:cd -swaprun:net setargv.obj
+!endif
 
 # see comments in allocate_heap in w32heap.c before changing any of the
 # -stack, -heap, or -base settings.
@@ -184,16 +196,20 @@
 !ifdef NODEBUG
 DEBUG_FLAG =
 DEBUG_LINK =
+D =
 !else
 DEBUG_FLAG = -Zi
-DEBUG_LINK = -debug:full
+DEBUG_LINK = -debug
+D = d
 !endif
 
 !if "$(ARCH)" == "i386"
 !ifdef NOOPT
-ARCH_CFLAGS     = -nologo -c -Zel -W2 -H63 -Od -G3d -Zp8 $(DEBUG_FLAG)
+#ARCH_CFLAGS     = -nologo -c -Zel -W2 -H63 -Od -G3d -Zp8 $(DEBUG_FLAG)
+ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zl -Zp8 -W2 -Od -Gd $(DEBUG_FLAG)
 !else
-ARCH_CFLAGS     = -nologo -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 $(DEBUG_FLAG)
+#ARCH_CFLAGS     = -nologo -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF -Zp8 
$(DEBUG_FLAG)
+ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zl -Zp8 -W2 -Oi -Ot -Oy- -Ob2 -GF -Gy 
-Gd $(DEBUG_FLAG)
 !endif
 ARCH_LDFLAGS   = $(SYS_LDFLAGS)
 

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-11-04 20:01:06 +0000
+++ b/src/ChangeLog     2011-11-05 11:34:56 +0000
@@ -1,3 +1,38 @@
+2011-11-05  Eli Zaretskii  <address@hidden>
+
+       Support MSVC build with newer versions of Visual Studio.
+       * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
+       Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
+       nt/gmake.defs.
+
+       * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
+       which are not supported by MSVC.
+       (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
+       (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
+       bitfields.
+       (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
+       types in bitfields.
+       (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
+
+       * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
+
+2011-11-05  Fabrice Popineau  <address@hidden> (tiny change)
+
+       Support MSVC build with newer versions of Visual Studio.
+       * w32.c: Don't include w32api.h for MSVC.
+       (init_environment) [_MSC_VER]: Call sys_access, not _access.
+
+       * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
+       [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
+       (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
+       (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
+       e_* cousins.
+       (alloca) [_MSC_VER]: Define to _alloca.
+
+       * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
+
+       * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
+
 2011-11-04  Eli Zaretskii  <address@hidden>
 
        * xdisp.c (note_mouse_highlight): If either of

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2011-10-28 13:48:19 +0000
+++ b/src/lisp.h        2011-11-05 11:34:56 +0000
@@ -168,6 +168,9 @@
 #  if HAVE_ATTRIBUTE_ALIGNED
 #   define DECL_ALIGN(type, var) \
      type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
+#  elif defined(_MSC_VER)
+#   define DECL_ALIGN(type, var) \
+     type __declspec(align(1 << GCTYPEBITS)) var
 #  else
      /* What directives do other compilers use?  */
 #  endif
@@ -225,6 +228,15 @@
 # endif
 #endif
 
+/* Stolen from GDB.  The only known compiler that doesn't support
+   enums in bitfields is MSVC.  */
+#ifdef _MSC_VER
+#define ENUM_BF(TYPE) unsigned int
+#else
+#define ENUM_BF(TYPE) enum TYPE
+#endif
+
+
 enum Lisp_Type
   {
     /* Integer.  XINT (obj) is the integer value.  */
@@ -315,12 +327,12 @@
        /* Use explict signed, the signedness of a bit-field of type
           int is implementation defined.  */
        signed EMACS_INT val  : VALBITS;
-       enum Lisp_Type type : GCTYPEBITS;
+       ENUM_BF (Lisp_Type) type : GCTYPEBITS;
       } s;
     struct
       {
        EMACS_UINT val : VALBITS;
-       enum Lisp_Type type : GCTYPEBITS;
+       ENUM_BF (Lisp_Type) type : GCTYPEBITS;
       } u;
   }
 Lisp_Object;
@@ -336,14 +348,14 @@
 
     struct
       {
-       enum Lisp_Type type : GCTYPEBITS;
+       ENUM_BF (Lisp_Type) type : GCTYPEBITS;
        /* Use explict signed, the signedness of a bit-field of type
           int is implementation defined.  */
        signed EMACS_INT val  : VALBITS;
       } s;
     struct
       {
-       enum Lisp_Type type : GCTYPEBITS;
+       ENUM_BF (Lisp_Type) type : GCTYPEBITS;
        EMACS_UINT val : VALBITS;
       } u;
   }
@@ -1096,7 +1108,7 @@
      1 : it's a varalias, the value is really in the `alias' symbol.
      2 : it's a localized var, the value is in the `blv' object.
      3 : it's a forwarding variable, the value is in `forward'.  */
-  enum symbol_redirect redirect : 3;
+  ENUM_BF (symbol_redirect) redirect : 3;
 
   /* Non-zero means symbol is constant, i.e. changing its value
      should signal an error.  If the value is 3, then the var
@@ -1309,7 +1321,7 @@
 
 struct Lisp_Misc_Any           /* Supertype of all Misc types.  */
 {
-  enum Lisp_Misc_Type type : 16;               /* = Lisp_Misc_??? */
+  ENUM_BF (Lisp_Misc_Type) type : 16;          /* = Lisp_Misc_??? */
   unsigned gcmarkbit : 1;
   int spacer : 15;
   /* Make it as long as "Lisp_Free without padding".  */
@@ -1318,7 +1330,7 @@
 
 struct Lisp_Marker
 {
-  enum Lisp_Misc_Type type : 16;               /* = Lisp_Misc_Marker */
+  ENUM_BF (Lisp_Misc_Type) type : 16;          /* = Lisp_Misc_Marker */
   unsigned gcmarkbit : 1;
   int spacer : 13;
   /* This flag is temporarily used in the functions
@@ -1468,7 +1480,7 @@
    I.e. 9words plus 2 bits, 3words of which are for external linked lists.
 */
   {
-    enum Lisp_Misc_Type type : 16;     /* = Lisp_Misc_Overlay */
+    ENUM_BF (Lisp_Misc_Type) type : 16;        /* = Lisp_Misc_Overlay */
     unsigned gcmarkbit : 1;
     int spacer : 15;
     struct Lisp_Overlay *next;
@@ -1487,7 +1499,7 @@
    This type of object is used in the arg to record_unwind_protect.  */
 struct Lisp_Save_Value
   {
-    enum Lisp_Misc_Type type : 16;     /* = Lisp_Misc_Save_Value */
+    ENUM_BF (Lisp_Misc_Type) type : 16;        /* = Lisp_Misc_Save_Value */
     unsigned gcmarkbit : 1;
     int spacer : 14;
     /* If DOGC is set, POINTER is the address of a memory
@@ -1501,7 +1513,7 @@
 /* A miscellaneous object, when it's on the free list.  */
 struct Lisp_Free
   {
-    enum Lisp_Misc_Type type : 16;     /* = Lisp_Misc_Free */
+    ENUM_BF (Lisp_Misc_Type) type : 16;        /* = Lisp_Misc_Free */
     unsigned gcmarkbit : 1;
     int spacer : 15;
     union Lisp_Misc *chain;
@@ -1896,13 +1908,23 @@
 
 /* This version of DEFUN declares a function prototype with the right
    arguments, so we can catch errors with maxargs at compile-time.  */
-#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
-  Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;                          \
-  static DECL_ALIGN (struct Lisp_Subr, sname) =                                
\
-    { PVEC_SUBR,                                                       \
-      { .a ## maxargs = fnname },                              \
-      minargs, maxargs, lname, intspec, 0};                            \
-  Lisp_Object fnname
+#ifdef _MSC_VER
+#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc)    \
+   Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;                         \
+   static DECL_ALIGN (struct Lisp_Subr, sname) =                       \
+     { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)),   \
+      { (Lisp_Object (__cdecl *)(void))fnname },                        \
+       minargs, maxargs, lname, intspec, 0};                           \
+   Lisp_Object fnname
+#else  /* not _MSC_VER */
+#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc)    \
+   Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;                         \
+   static DECL_ALIGN (struct Lisp_Subr, sname) =                       \
+     { PVEC_SUBR,                                                      \
+      { .a ## maxargs = fnname },                                      \
+       minargs, maxargs, lname, intspec, 0};                           \
+   Lisp_Object fnname
+#endif
 
 /* Note that the weird token-substitution semantics of ANSI C makes
    this work for MANY and UNEVALLED.  */

=== modified file 'src/makefile.w32-in'
--- a/src/makefile.w32-in       2011-08-27 01:42:00 +0000
+++ b/src/makefile.w32-in       2011-11-05 11:34:56 +0000
@@ -348,11 +348,11 @@
 TAGS-gmake:
        ../lib-src/$(BLD)/etags.exe --include=TAGS-LISP --include=../nt/TAGS \
          address@hidden/nt/emacs-src.tags \
-         $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ0))
-       ../lib-src/$(BLD)/etags.exe -a address@hidden/nt/emacs-src.tags \
-         $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1))
-       ../lib-src/$(BLD)/etags.exe -a address@hidden/nt/emacs-src.tags \
-         $(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) \
+         $(OBJ0_c)
+       ../lib-src/$(BLD)/etags.exe -a address@hidden/nt/emacs-src.tags \
+         $(OBJ1_c)
+       ../lib-src/$(BLD)/etags.exe -a address@hidden/nt/emacs-src.tags \
+         $(OBJ2_c) \
          $(CURDIR)/*.h $(CURDIR)/m/intel386.h $(CURDIR)/s/ms-w32.h
 
 TAGS-nmake:

=== modified file 'src/regex.c'
--- a/src/regex.c       2011-09-09 01:06:52 +0000
+++ b/src/regex.c       2011-11-05 11:34:56 +0000
@@ -530,7 +530,11 @@
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 
 /* Type of source-pattern and string chars.  */
+#ifdef _MSC_VER
+typedef unsigned char re_char;
+#else
 typedef const unsigned char re_char;
+#endif
 
 typedef char boolean;
 #define false 0

=== modified file 'src/s/ms-w32.h'
--- a/src/s/ms-w32.h    2011-07-07 01:32:56 +0000
+++ b/src/s/ms-w32.h    2011-11-05 11:34:56 +0000
@@ -86,6 +86,12 @@
 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
 
 #include <sys/types.h>
+
+#ifdef _MSC_VER
+typedef unsigned long sigset_t;
+typedef int ssize_t;
+#endif
+
 struct sigaction {
   int sa_flags;
   void (*sa_handler)(int);
@@ -181,6 +187,12 @@
 
 #ifdef emacs
 
+#ifdef _MSC_VER
+#include <sys/timeb.h>
+#include <sys/stat.h>
+#include <signal.h>
+#endif
+
 /* Calls that are emulated or shadowed.  */
 #undef access
 #define access  sys_access
@@ -270,6 +282,15 @@
 #define utime    _utime
 #endif
 
+#ifdef _MSC_VER
+/* MSVC gets link-time errors without these redirections.  */
+#define fstat(a, b) sys_fstat(a, b)
+#define stat(a, b)  sys_stat(a, b)
+#if _MSC_VER >= 1400
+#define utime       sys_utime
+#endif
+#endif
+
 /* This is hacky, but is necessary to avoid warnings about macro
    redefinitions using the SDK compilers.  */
 #ifndef __STDC__
@@ -317,13 +338,17 @@
 #define _WINSOCK_H
 
 /* Defines size_t and alloca ().  */
-#ifdef USE_CRT_DLL
+#if (defined(_MSC_VER) && defined(emacs)) || defined(USE_CRT_DLL)
 #define malloc e_malloc
 #define free   e_free
 #define realloc e_realloc
 #define calloc e_calloc
 #endif
+#ifdef _MSC_VER
+#define alloca _alloca
+#else
 #include <malloc.h>
+#endif
 
 #include <sys/stat.h>
 

=== modified file 'src/w32.c'
--- a/src/w32.c 2011-10-27 00:59:21 +0000
+++ b/src/w32.c 2011-11-05 11:34:56 +0000
@@ -94,7 +94,9 @@
 
 #include <tlhelp32.h>
 #include <psapi.h>
+#ifndef _MSC_VER
 #include <w32api.h>
+#endif
 #if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || 
(__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15)
 /* This either is not in psapi.h or guarded by higher value of
    _WIN32_WINNT than what we use.  w32api supplied with MinGW 3.15
@@ -1547,7 +1549,12 @@
         read-only filesystem, like CD-ROM or a write-protected floppy.
         The only way to be really sure is to actually create a file and
         see if it succeeds.  But I think that's too much to ask.  */
+#ifdef _MSC_VER
+      /* MSVC's _access crashes with D_OK.  */
+      if (tmp && sys_access (tmp, D_OK) == 0)
+#else
       if (tmp && _access (tmp, D_OK) == 0)
+#endif
        {
          char * var = alloca (strlen (tmp) + 8);
          sprintf (var, "TMPDIR=%s", tmp);

=== modified file 'src/w32fns.c'
--- a/src/w32fns.c      2011-11-03 19:04:18 +0000
+++ b/src/w32fns.c      2011-11-05 11:34:56 +0000
@@ -140,8 +140,8 @@
     DWORD   dwFlags;
 };
 
-/* Reportedly, VS 6 does not have this in its headers.  */
-#if defined (_MSC_VER) && _MSC_VER < 1300
+/* Reportedly, MSVC does not have this in its headers.  */
+#ifdef _MSC_VER
 DECLARE_HANDLE(HMONITOR);
 #endif
 


reply via email to

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