GNU bug report logs - #9960
Compiling Emacs trunk with MSVC

Previous Next

Packages: emacs, w32;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sat, 5 Nov 2011 11:24:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Christoph Scholtes <cschol2112 <at> googlemail.com>
Cc: fabrice.popineau <at> supelec.fr, 9960 <at> debbugs.gnu.org
Subject: bug#9960: Compiling Emacs trunk with MSVC
Date: Sat, 05 Nov 2011 16:16:40 +0200
> Date: Sat, 05 Nov 2011 07:58:12 -0600
> From: Christoph Scholtes <cschol2112 <at> googlemail.com>
> CC: fabrice.popineau <at> supelec.fr, 9960 <at> debbugs.gnu.org
> 
> On 11/5/2011 7:22 AM, Eli Zaretskii wrote:
> 
> > Does this patch give good results?
> 
> Yes. Better. Thanks.

Committed.

> Then it can't find a definition of `mode_t' in `strmode'.
> 
> This patch will fix this error:
> 
>   /* Define to the equivalent of the C99 'restrict' keyword, or to
>      nothing if this is not supported.  Do not define if restrict is
> @@ -341,6 +345,13 @@
>   # define restrict
>   #endif
> 
> +/* Define to `int' if <sys/types.h> does not define. */
> +#ifdef __GNUC__
> +/* No action required for gcc */
> +#else /* MSVC */
> +#define mode_t int
> +#endif
> +
>   /* A va_copy replacement for MSVC.  */
>   #ifdef _MSC_VER
>   # ifdef _WIN64

Please commit this, thanks.

> After that, I get a link error for ctags:
> 
> ctags.obj : error LNK2019: unresolved external symbol _sys_stat 
> referenced in fu
> nction _process_file_name
> obj/i386/ctags.exe : fatal error LNK1120: 1 unresolved externals
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
> Studio 9.0\
> VC\BIN\link.EXE"' : return code '0x460'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
> Studio 9.0\
> VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
> 
> I am not sure what to do about _sys_stat.

Try this one:

=== modified file 'src/s/ms-w32.h'
--- src/s/ms-w32.h	2011-11-05 11:34:56 +0000
+++ src/s/ms-w32.h	2011-11-05 14:15:45 +0000
@@ -191,6 +191,11 @@ struct sigaction {
 #include <sys/timeb.h>
 #include <sys/stat.h>
 #include <signal.h>
+
+/* MSVC gets link-time errors without these redirections.  */
+#define fstat(a, b) sys_fstat(a, b)
+#define stat(a, b)  sys_stat(a, b)
+#define utime       sys_utime
 #endif
 
 /* Calls that are emulated or shadowed.  */
@@ -279,18 +284,10 @@ typedef int pid_t;
 
 #if !defined (_MSC_VER) || (_MSC_VER < 1400)
 #define tzname    _tzname
+#undef  utime
 #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__





This bug report was last modified 13 years and 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.