Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ac43t-0001Hi-SM for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Mar 2016 04:43:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ac43t-0002Sa-29 for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Mar 2016 04:43:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ac42X-0000yj-UL for pgsql-hackers@postgresql.org; Sat, 05 Mar 2016 04:42:05 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ac42U-00049z-1t for pgsql-hackers@postgresql.org; Sat, 05 Mar 2016 04:42:04 +0000 Received: by mail-wm0-x22e.google.com with SMTP id l68so13435334wml.1 for ; Fri, 04 Mar 2016 20:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=EV2HPSxZ0gp7moEYxDjLmD0Z3OiX2uhCzSeepqifRxQ=; b=uZU6oPEdo+tV06y+H7hqRjVc3WkS4ZemVU7F3KEhj+0jIqdWl56B9XnYSDqcpcSn6b crymsvlQB26emqZkevVxcSm5FDT1HXZ3ZbELydFWR40Ubuf7G4T//jR1Z6bcAhTugP+H 3Vzftzqe+h8ujFtOAazIiWy/Xf88xQi5BJB0ONlz0cQRMa1itz/fBiRVSPkJkRHA4Gn9 XUUKtVzCff4a6wTcepy4V/amHwa45/1U9hR2BZvq+UbBtdLO7r0H2FGOb0PKnAB36skb dEk4I4Ddg+Xlh7B038MBBBHOsZx9rwxKtOjTcfSg4txZA1/lLpkoEJSbzsOuHJxYDQBg DpNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=EV2HPSxZ0gp7moEYxDjLmD0Z3OiX2uhCzSeepqifRxQ=; b=NYkQqV2Hz2scGMcod4nFrkTJpOF/+2dSs8AXQwPbaogq2/dThetBPUR4e2dOu8glk5 eKo+LuetkD8ItfNJOfbjN9F0XPcdIg2bI5gJCKQpuyXIiptXDCLXBdEaZKnjUUHU8lAB v/x1s/uUf5DLHF0ri86VSffQOPvCmmyGvnhxPhZVF1A0Z6EKzlw69bEPmFjTrr/boaFV Sb2EBTFBjMj5CtU8XONxQ5NwOnDVsGOdxUdy9xxPtd+VUn22MXQwWVkWpgRUB6sSTxGI vqQnFYEqOH8zIDnFkP1sYnQlqYniVCFIdsFDORlEnO6u/Q0F8HgBvyPq2crnC6EI0uP2 BG6g== X-Gm-Message-State: AD7BkJL7OiL2evnUUVjrP6+TIMQ/R07qafXif44gd6qezAF1up9SFc1yVLDGei9TmCwZz4By5tNTRv3ahTTC50nE8w1RZ5AHO7z1qoXOd/0iLjgtJpJMmL3+zf5LVGnaLwBpNjsseMr+JmfwQVhfhtgE+7pVZHVmNPa0uzGFjVn2tF1Zi7lQGgzA+httSEzW1w== X-Received: by 10.194.201.130 with SMTP id ka2mr11667048wjc.34.1457152919932; Fri, 04 Mar 2016 20:41:59 -0800 (PST) Received: from [192.168.0.103] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id xx3sm6327532wjc.32.2016.03.04.20.41.57 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2016 20:41:58 -0800 (PST) Subject: Re: VS 2015 support in src/tools/msvc To: Michael Paquier References: <56D871CE.8020709@dunslane.net> <56D8B8E3.5070708@2ndquadrant.com> Cc: Magnus Hagander , Andrew Dunstan , PostgreSQL mailing lists From: Petr Jelinek Message-ID: <56DA6394.9040404@2ndquadrant.com> Date: Sat, 5 Mar 2016 05:41:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 04/03/16 15:23, Michael Paquier wrote: > > OK, attached are a set of patches that allowed me to compile Postgres > using VS2015, in more details: > - 0001, as mentioned by Petr upthread, psed is removed from the core > distribution of Perl in 5.22, so when installing ActivePerl it is not > possible to create probes.h, and the code compilation would fail. I > bumped into that so here is a patch. What I am proposing here is to > replace psed by sed, sed being available in MSYS like bison and flex, > so when building using MSVC the environment to set up is normally > already good to go even with this additional dependency. Now, it is > important to mention that probes.h is not part of a source tarball. I > think that we would want probes.h to be part of a source tarball so as > it would be possible to compile the code on Windows using MSVC without > having to install MSYS. I haven't done that in this patch, thoughts on > the matter are welcome. I vote for just using sed considering we need flex and bison anyway. > - 0003, to address a compilation failure that I bumped into when > compiling ecpg. In src/port, TIMEZONE_GLOBAL and TZNAME_GLOBAL refer > to respectively timezone and tzname, however for win32, those should > be _timezone and _tzname. See here: > https://msdn.microsoft.com/en-us/library/htb3tdkc.aspx Yep I hit that one as well, looks good. > - 0004, which is to address the problem of the missing lc_codepage > from locale.h in src/port/. I have been pondering about the use of > more fancy routines like GetLocaleInfoEx as mentioned by Petr > upthread. However, I think that we had better avoid any kind of > complication and just fall back to the old code path should _MSC_VER >> = 1900. We could always reuse lc_codepage if it gets reintroduced in > a future version of VS. Well I am worried that this way we might break existing installs which means we can't backpatch this. The problem here is that the fallback code does not support the - format which Microsoft documents everywhere as recommended locale format. The good news is that our own initdb won't auto-generate those when no locale was specified as it uses the setlocale() which returns the legacy (and not recommended) locale names and our fallback code can handle those. But manually set locales can be a problem. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers