From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#9960: Compiling Emacs trunk with MSVC Date: Sat, 05 Nov 2011 16:16:40 +0200 Message-ID: <83r51mk62f.fsf@gnu.org> References: <83sjy5279e.fsf@gnu.org> <8339e2lsu7.fsf@gnu.org> <83zkgakdby.fsf@gnu.org> <4EB5320F.5090800@gmail.com> <83vcqyk8k3.fsf@gnu.org> <4EB540F4.7080106@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1320502718 1772 80.91.229.12 (5 Nov 2011 14:18:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 5 Nov 2011 14:18:38 +0000 (UTC) Cc: fabrice.popineau@supelec.fr, 9960@debbugs.gnu.org To: Christoph Scholtes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 05 15:18:28 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RMh4l-0004u1-DB for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Nov 2011 15:18:27 +0100 Original-Received: from localhost ([::1]:46078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMh4k-0001xx-Vj for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Nov 2011 10:18:26 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMh4i-0001xf-4e for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2011 10:18:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMh4g-0005xB-De for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2011 10:18:24 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMh4g-0005x7-At for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2011 10:18:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RMh7G-0006U8-BB for bug-gnu-emacs@gnu.org; Sat, 05 Nov 2011 10:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Nov 2011 14:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9960 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9960-submit@debbugs.gnu.org id=B9960.132050282724884 (code B ref 9960); Sat, 05 Nov 2011 14:21:02 +0000 Original-Received: (at 9960) by debbugs.gnu.org; 5 Nov 2011 14:20:27 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMh6g-0006TJ-RG for submit@debbugs.gnu.org; Sat, 05 Nov 2011 10:20:27 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMh6d-0006T9-B2 for 9960@debbugs.gnu.org; Sat, 05 Nov 2011 10:20:24 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LU600000Y3P1W00@a-mtaout21.012.net.il> for 9960@debbugs.gnu.org; Sat, 05 Nov 2011 16:17:41 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.228.70.69]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LU6000NNYDF1830@a-mtaout21.012.net.il>; Sat, 05 Nov 2011 16:17:41 +0200 (IST) In-reply-to: <4EB540F4.7080106@gmail.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 05 Nov 2011 10:21:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:53549 Archived-At: > Date: Sat, 05 Nov 2011 07:58:12 -0600 > From: Christoph Scholtes > CC: fabrice.popineau@supelec.fr, 9960@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 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 #include #include + +/* 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__