Re: BUG #18219: libpq does not take into consideration UNICODE define

From: Jan Březina <2janbrezina(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18219: libpq does not take into consideration UNICODE define
Date: 2023-11-30 21:10:47
Message-ID: CABODNCzp04S1UKt+mr8GyY1LYxpXDLpT6PYOvBaS=+bBNfTEGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I defined UNICODE for the whole project and it's propagated also to the
dependencies. Vcpkg is just the package manager. You can see it's port in
the public repository:
https://github.com/Microsoft/vcpkg/blob/master/ports/libpq/portfile.cmake

Dne čt 30. 11. 2023 20:20 uživatel Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
napsal:

> On Fri, Dec 1, 2023 at 4:50 AM PG Bug reporting form
> <noreply(at)postgresql(dot)org> wrote:
> > I use libpqxx via vcpkg in Windows project build for x64 system using
> Visual
> > Studio. There is a UNICODE define, which causes **W Windows functions to
> be
> > used and hence string parameters should be passed in using L"...".
> > I have sslrootcert file used in my connection string. During the
> connection
> > initialization stat() function is invoked for the file. It is
> implemented in
> > win32stat.c, which then invokes pgwin32_open_handle() (open.c) and then
> > initialize_ntdll() (win32ntdll.c) is invoked. There is a use of
> > LoadLibraryEx which is just a define above LoadLibraryExA or
> LoadLibraryExW.
> > Using UNICODE implies LoadLibraryExW to be used, but the parameter
> passed in
> > is char*, not wchar_t*. This leads to failed initialization returning
> error
> > code 126 - The specified module could not be found.
> > There should be a switch if UNICODE is defined, then L"ntdll.dll" should
> be
> > passed in. The same applies to all other Windows functions consuming
> > strings.
>
> I don't understand vcpkg so I don't even know where to look, but who
> defined UNICODE when building libpq?
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2023-11-30 21:20:30 Re: BUG #18219: libpq does not take into consideration UNICODE define
Previous Message Thomas Munro 2023-11-30 19:20:19 Re: BUG #18219: libpq does not take into consideration UNICODE define