From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dhruva Newsgroups: gmane.emacs.devel Subject: Re: Build failure on Windows using MSVC Date: Fri, 15 Aug 2008 18:07:09 +0530 (IST) Message-ID: <647527.46730.qm@web95006.mail.in2.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1218803874 12195 80.91.229.12 (15 Aug 2008 12:37:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Aug 2008 12:37:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 15 14:38:46 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KTyZZ-0005o4-D5 for ged-emacs-devel@m.gmane.org; Fri, 15 Aug 2008 14:38:29 +0200 Original-Received: from localhost ([127.0.0.1]:37252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTyYd-0001U3-0j for ged-emacs-devel@m.gmane.org; Fri, 15 Aug 2008 08:37:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTyYM-0001LV-5t for emacs-devel@gnu.org; Fri, 15 Aug 2008 08:37:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTyYL-0001Kx-0A for emacs-devel@gnu.org; Fri, 15 Aug 2008 08:37:13 -0400 Original-Received: from [199.232.76.173] (port=57086 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTyYK-0001Kr-P3 for emacs-devel@gnu.org; Fri, 15 Aug 2008 08:37:12 -0400 Original-Received: from n2a.bullet.in.yahoo.com ([202.43.219.19]:29222) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KTyYJ-0007kz-Fs for emacs-devel@gnu.org; Fri, 15 Aug 2008 08:37:12 -0400 Original-Received: from [202.86.4.170] by n2.bullet.in.yahoo.com with NNFMP; 15 Aug 2008 12:37:09 -0000 Original-Received: from [203.104.18.52] by t1.bullet.in.yahoo.com with NNFMP; 15 Aug 2008 12:37:09 -0000 Original-Received: from [127.0.0.1] by omp113.mail.in2.yahoo.com with NNFMP; 15 Aug 2008 12:37:09 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 741082.21826.bm@omp113.mail.in2.yahoo.com Original-Received: (qmail 47403 invoked by uid 60001); 15 Aug 2008 12:37:09 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ymail.com; h=Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=o0ybFZQbyVbFbKt+RxLFBrPEnIQ9oBls6DOyaDMAKF4KMQSHts8439E9nyXFRNuiNvOZaRVEb5VlbPVJIXnifVY/9NqOF+u9a1lg14ioDxGePKGKCrk3j3A8YqDGHW4eEoh21F8KZ80Ii+Ye0w5IUQcsW/cgQ5Gy1OOmIrXK+Wc=; Original-Received: from [59.92.190.205] by web95006.mail.in2.yahoo.com via HTTP; Fri, 15 Aug 2008 18:07:09 IST X-Mailer: YahooMailRC/1042.48 YahooMailWebService/0.7.218 X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:102481 Archived-At: Hi Eli,=0A This is the error message I get when I get to compile. I agree W= INVER is deprecated but _WIN32_WINNT is not defined after including windows= ..h, I therefore used WINVER instead which is defined. For sake of completen= ess, the windows.h comes from the PlatformSDK installed as part of Visual S= tudio installation.=0A Another alternative at fixing this would be to test = it in configure. That may be a foolproof approach.=0A=0AThe compilation err= or I notice:=0A=0A cl -I. -nologo -c -Zel -W2 -H63 -Oxsb2 -Oy- -G6dF= -Zp8 -Zi /Ic:/tools/msvcimage/include -Demacs=3D1 -DHAVE_CONFIG_H -I../n= t/inc -DHAVE_NTGUI=3D1 -Foobj-spd/i386\ w32.c=0Aw32.c=0Aw32.c(78) : error = C2011: '_MEMORYSTATUSEX' : 'struct' type redefinition=0A C:\Program = Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinBase.h(1= 723) : see declaration of '_MEMORYSTATUSEX'=0Aw32.c(3605) : warning C4244: = '=3D' : conversion from 'long double' to 'long', possible loss of data=0Aw3= 2.c(3606) : warning C4244: '=3D' : conversion from 'long double' to 'long',= possible loss of data=0Aw32.c(3609) : warning C4244: '=3D' : conversion fr= om 'long double' to 'long', possible loss of data=0Aw32.c(3610) : warning C= 4244: '=3D' : conversion from 'long double' to 'long', possible loss of dat= a=0Aw32.c(3616) : warning C4244: '=3D' : conversion from 'long double' to '= long', possible loss of data=0Aw32.c(3617) : warning C4244: '=3D' : convers= ion from 'long double' to 'long', possible loss of data=0Aw32.c(3621) : war= ning C4244: '=3D' : conversion from 'long double' to 'long', possible loss = of data=0Aw32.c(3622) : warning C4244: '=3D' : conversion from 'long double= ' to 'long', possible loss of data=0Aw32.c(3668) : warning C4244: '=3D' : c= onversion from 'double' to 'DWORD', possible loss of data=0ANMAKE : fatal e= rror U1077: 'cl' : return code '0x2'=0AStop.=0ANMAKE : fatal error U1077: '= "C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN\nmake.exe"' : r= eturn code '0x2'=0AStop.=0A=0A-dhruva=0A=0A=0A=0A----- Original Message ---= -=0A> From: Eli Zaretskii =0A> To: dhruva = =0A> Cc: emacs-devel@gnu.org=0A> Sent: Friday, 15 August, 2008 3:01:13 PM= =0A> Subject: Re: Build failure on Windows using MSVC=0A> =0A> > Date: Fri,= 15 Aug 2008 13:19:37 +0530 (IST)=0A> > From: dhruva =0A> > =0A> > Build o= f Emacs from HEAD on WXP using MSVC 2003 fails due to redefinition of =0A> = a structure MEMORYSTATUSEX. The following patch fixes the issue on WXP (W2K= prof =0A> and upwards as that structure is available on W2K+). Need to tes= t on older =0A> versions and I have no access to it.=0A> =0A> What is the e= xact error message emitted by Studio 2003? Is there=0A> perhaps a compiler= switch to avoid such an error? Is our definition=0A> incompatible with wh= at VS 2003 defines?=0A> =0A> I need the above information to come up with a= suitable solution that=0A> will work with all supported platforms and comp= iler versions. Someone=0A> else compiled this CVS code with VS 6 and didn'= t have this problem, so=0A> we need to find a solution that doesn't break v= ersions of VS other=0A> than yours.=0A> =0A> > =3D=3D=3D modified file 'src= /w32.c'=0A> > --- src/w32.c 2008-08-10 01:05:02 +0000=0A> > +++ src/w32..= c 2008-08-15 07:43:51 +0000=0A> > @@ -73,6 +73,7 @@=0A> > #define _ANONY= MOUS_STRUCT=0A> > #endif=0A> > #include =0A> > +#if (WINVER<0x0500)=0A> = =0A> I don't want to use WINVER. It's an old and deprecated macro, and we= =0A> already use its more modern replacement _WIN32_WINNT. Also, the=0A> a= vailability of the function at run time is not an issue here, since=0A> the= code dynamically tests that and only uses the function if it's=0A> availab= le. The issue is compilation.=0A> =0A> From your report, I understand that= the MS header files do not guard=0A> the declaration of MEMORYSTATUSEX wit= h _WIN32_WINNT, like the MinGW=0A> headers do? Can you verify that, please= ?=0A> =0A> If this is so, I prefer to condition the declaration on __MINGW3= 2__=0A> rather than use WINVER. The only thing that bothers me is VS 6 (se= e=0A> above).=0A=0A=0A=0A Unlimited freedom, unlimited storage. Get it= now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.htm= l/