From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20795 invoked by alias); 18 Nov 2014 16:02:24 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 20786 invoked by uid 89); 18 Nov 2014 16:02:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 18 Nov 2014 16:02:23 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAIG2B3V022706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 18 Nov 2014 11:02:12 -0500 Received: from pike.twiddle.home (vpn1-5-51.ams2.redhat.com [10.36.5.51]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAIG27ix012808; Tue, 18 Nov 2014 11:02:09 -0500 Message-ID: <546B6D7D.9010804@redhat.com> Date: Tue, 18 Nov 2014 16:02:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: =?UTF-8?B?R3LDqWdvcnkgUGFrb3N6?= , "libffi-discuss@sourceware.org" CC: "nield.a.d@gmail.com" , "rth@twiddle.net" Subject: Re: libffi 3.2.1 and master, can't build with Visual Studio 2012 References: <1416324204734.161@myscript.com> In-Reply-To: <1416324204734.161@myscript.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014/txt/msg00246.txt.bz2 On 11/18/2014 04:23 PM, Grégory Pakosz wrote: > ​Hello, > > I would like to inform you it's not possible to build libffi 3.2.1 with Visual Studio 2012 anymore as it's not a C99 compiler. > > In src/x86/ffi.c, > > - src/x86/ffi.c doesn't compile because > - commit 098dca6b31e declares "size_t z" variables not at the beginning of blocks which is possible in C99 only > - commit 5d6340ef2cf8 moves "int i" variable declaration from beginning to middle of block > - this appears to be fixed in master by commit b21ec1ce783​ though These are simply oversights that can easily be fixed. > static const struct abi_params abi_params[FFI_LAST_ABI] = { > [FFI_SYSV] = { 1, 0 }, > [FFI_THISCALL] = { 1, 1, { R_ECX } }, > [FFI_FASTCALL] = { 1, 2, { R_ECX, R_EDX } }, > [FFI_STDCALL] = { 1, 0 }, > [FFI_PASCAL] = { -1, 0 }, > [FFI_REGISTER] = { -1, 3, { R_EAX, R_EDX, R_ECX } }, > [FFI_MS_CDECL] = { 1, 0 } > }; This one's tricky, without simply forcing X86 an X86_WIN32 to have the same ffi_abi enumeration. Currently, while they have the same symbols, the symbols have different values. So *not* using designated initializers is hard. I suppose we could fill in the values at runtime from a switch statement, but read-only data appeals to me... And all of that's moot without re-porting the assembly back to masm, which I was not looking forward to doing. I have downloaded the recently released gratis VS 2013 Community, but I havn't yet looked into it enough to figure out how to actually do things with it. Do I really have to create some sort of project to get things to build, or is there a command-line compiler included? How are you building libffi with VS? r~