pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Error when compiling postgresql 9.6.7 with Visual Studio 15.5.6
6+ messages / 4 participants
[nested] [flat]

* Error when compiling postgresql 9.6.7 with Visual Studio 15.5.6
@ 2018-02-19 16:57  Aditya Nugraha <vortexilation@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Aditya Nugraha @ 2018-02-19 16:57 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hello everyone,

   When trying to compile postgresql 9.6.7 with Visual Studio 15.5.6,
i am getting errors at these following line :
"C:\Users\nameless\Documents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\pgsql.sln"
(default targe
t) (1) ->
"C:\Users\nameless\Documents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\ascii_and_mic.vcxproj"
(d
efault target) (5) ->
"C:\Users\nameless\Documents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxproj"
(defaul
t target) (6) ->
(ClCompile target) ->
  src/backend/utils/adt/pg_locale.c(927): error C2037: left of
'locale_name' specifies undefined struct/union '__crt_lo
cale_data' [C:\Users\nameless\Documents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxpr
oj]
  src/backend/utils/adt/pg_locale.c(928): error C2198: 'wchar2char':
too few arguments for call [C:\Users\nameless\Docum
ents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxproj]

    4 Warning(s)
    2 Error(s)

Searching through the mailinglist archive i am getting this thread :
http://www.postgresql-archive.org/Building-PostgreSQL-9-6devel-sources-with-Microsoft-Visual-C-2015-...

But the intended patched file is different than above error which is
on this src/backend/utils/adt/pg_locale.c file.

Here is the snapshot of the offending code from pg_locale.c file :
/* Locale names use only ASCII, any conversion locale suffices. */
rc = wchar2char(iso_lc_messages, loct->locinfo->locale_name[LC_CTYPE],
sizeof(iso_lc_messages), NULL);

Can anyone tell me the fixes ?.


Cheers.



Aditya




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Error when compiling postgresql 9.6.7 with Visual Studio 15.5.6
@ 2018-02-19 17:23  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Aditya Nugraha <vortexilation@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2018-02-19 17:23 UTC (permalink / raw)
  To: Aditya Nugraha <vortexilation@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

Aditya Nugraha <vortexilation@gmail.com> writes:
>    When trying to compile postgresql 9.6.7 with Visual Studio 15.5.6,
> i am getting errors at these following line :
>   src/backend/utils/adt/pg_locale.c(927): error C2037: left of
> 'locale_name' specifies undefined struct/union '__crt_lo
> cale_data' [C:\Users\nameless\Documents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxpr
> oj]
>   src/backend/utils/adt/pg_locale.c(928): error C2198: 'wchar2char':
> too few arguments for call [C:\Users\nameless\Docum
> ents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxproj]

This was previously discussed here:

https://www.postgresql.org/message-id/flat/CANFyU959RRvAqmrGvLor%3Dgo3PSi4LdYcjDw8TQ6YRvzpouZrog%40m...

Apparently Microsoft have changed their APIs in VS2015.  Somebody needs to
figure out what's the approved way now to get the locale name out of a
_locale_t object.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Error when compiling postgresql 9.6.7 with Visual Studio 15.5.6
@ 2018-02-19 20:54  Thomas Munro <thomas.munro@enterprisedb.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Thomas Munro @ 2018-02-19 20:54 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Aditya Nugraha <vortexilation@gmail.com>; pgsql-general@lists.postgresql.org

On Tue, Feb 20, 2018 at 6:23 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Aditya Nugraha <vortexilation@gmail.com> writes:
>>    When trying to compile postgresql 9.6.7 with Visual Studio 15.5.6,
>> i am getting errors at these following line :
>>   src/backend/utils/adt/pg_locale.c(927): error C2037: left of
>> 'locale_name' specifies undefined struct/union '__crt_lo
>> cale_data' [C:\Users\nameless\Documents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxpr
>> oj]
>>   src/backend/utils/adt/pg_locale.c(928): error C2198: 'wchar2char':
>> too few arguments for call [C:\Users\nameless\Docum
>> ents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxproj]
>
> This was previously discussed here:
>
> https://www.postgresql.org/message-id/flat/CANFyU959RRvAqmrGvLor%3Dgo3PSi4LdYcjDw8TQ6YRvzpouZrog%40m...
>
> Apparently Microsoft have changed their APIs in VS2015.  Somebody needs to
> figure out what's the approved way now to get the locale name out of a
> _locale_t object.

[Not a Windows person, just curious]

I wonder if the result of ResolveLocaleName("foo", output_buffer,
output_buffer_size) would be the same as
locale->locinfo->local_name[LC_TYPE] on the result of
_create_locale(LC_CTYPE, "foo").

https://msdn.microsoft.com/en-us/library/windows/desktop/dd319112(v=vs.85).aspx

-- 
Thomas Munro
http://www.enterprisedb.com




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Error when compiling postgresql 9.6.7 with Visual Studio 15.5.6
@ 2018-02-19 21:09  Aditya Nugraha <vortexilation@gmail.com>
  parent: Thomas Munro <thomas.munro@enterprisedb.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Aditya Nugraha @ 2018-02-19 21:09 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@enterprisedb.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general@lists.postgresql.org

Found out that the patch that is included in that discussion is
working fine for Visual Studio 2017 15.5.6, i think postgresql
developer should include it on upstream branch or 9.6.x variant.

Thanks a lot Tom!

@Thomas

I haven't checked it out but as above mentioned, the patch is working
fine so far, although i haven't check it thoroughly.

On Tue, Feb 20, 2018 at 3:54 AM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> On Tue, Feb 20, 2018 at 6:23 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Aditya Nugraha <vortexilation@gmail.com> writes:
>>>    When trying to compile postgresql 9.6.7 with Visual Studio 15.5.6,
>>> i am getting errors at these following line :
>>>   src/backend/utils/adt/pg_locale.c(927): error C2037: left of
>>> 'locale_name' specifies undefined struct/union '__crt_lo
>>> cale_data' [C:\Users\nameless\Documents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxpr
>>> oj]
>>>   src/backend/utils/adt/pg_locale.c(928): error C2198: 'wchar2char':
>>> too few arguments for call [C:\Users\nameless\Docum
>>> ents\Works\Compiling\pgwininstall\builddir\postgresql\postgresql-9.6.7\postgres.vcxproj]
>>
>> This was previously discussed here:
>>
>> https://www.postgresql.org/message-id/flat/CANFyU959RRvAqmrGvLor%3Dgo3PSi4LdYcjDw8TQ6YRvzpouZrog%40m...
>>
>> Apparently Microsoft have changed their APIs in VS2015.  Somebody needs to
>> figure out what's the approved way now to get the locale name out of a
>> _locale_t object.
>
> [Not a Windows person, just curious]
>
> I wonder if the result of ResolveLocaleName("foo", output_buffer,
> output_buffer_size) would be the same as
> locale->locinfo->local_name[LC_TYPE] on the result of
> _create_locale(LC_CTYPE, "foo").
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/dd319112(v=vs.85).aspx
>
> --
> Thomas Munro
> http://www.enterprisedb.com




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Error when compiling postgresql 9.6.7 with Visual Studio 15.5.6
@ 2018-02-19 21:17  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Aditya Nugraha <vortexilation@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2018-02-19 21:17 UTC (permalink / raw)
  To: Aditya Nugraha <vortexilation@gmail.com>; +Cc: Thomas Munro <thomas.munro@enterprisedb.com>; pgsql-general@lists.postgresql.org

Aditya Nugraha <vortexilation@gmail.com> writes:
> Found out that the patch that is included in that discussion is
> working fine for Visual Studio 2017 15.5.6, i think postgresql
> developer should include it on upstream branch or 9.6.x variant.

Well, as far as I'm concerned the patch that was proposed there is
far too fragile to be acceptable.  We need to find out what the
Microsoft-approved way of getting the information is.  Assuming that
we know the contents of non-exported data structures is surely not
what they have in mind, and it would undoubtedly break in the next VS
update.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Error when compiling postgresql 9.6.7 with Visual Studio 15.5.6
@ 2018-02-20 01:37  Michael Paquier <michael@paquier.xyz>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2018-02-20 01:37 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Aditya Nugraha <vortexilation@gmail.com>; Thomas Munro <thomas.munro@enterprisedb.com>; pgsql-general@lists.postgresql.org

On Mon, Feb 19, 2018 at 04:17:18PM -0500, Tom Lane wrote:
> Well, as far as I'm concerned the patch that was proposed there is
> far too fragile to be acceptable.  We need to find out what the
> Microsoft-approved way of getting the information is.  Assuming that
> we know the contents of non-exported data structures is surely not
> what they have in mind, and it would undoubtedly break in the next VS
> update.

Definitely agreed.  The locale-related code is *the* pain point when it
comes to MSVC things.  And each time we add support for a new version of
MSVC there is always something different happening and breaking.  There
has never been any discussion around ResolveLocaleName() though.  A
downside is that this would increase the minimal version support bar on
Windows.  Still that would be worth a serious look.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2018-02-20 01:37 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 16:57 Error when compiling postgresql 9.6.7 with Visual Studio 15.5.6 Aditya Nugraha <vortexilation@gmail.com>
2018-02-19 17:23 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-02-19 20:54   ` Thomas Munro <thomas.munro@enterprisedb.com>
2018-02-19 21:09     ` Aditya Nugraha <vortexilation@gmail.com>
2018-02-19 21:17       ` Tom Lane <tgl@sss.pgh.pa.us>
2018-02-20 01:37         ` Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox