Re: MinGW compiled client library

Поиск
Список
Период
Сортировка
От Michael Cronenworth
Тема Re: MinGW compiled client library
Дата
Msg-id 520CFAD2.8000304@cchtml.com
обсуждение исходный текст
Ответ на MinGW compiled client library  (Michael Cronenworth <mike@cchtml.com>)
Ответы Re: MinGW compiled client library  (Michael Cronenworth <mike@cchtml.com>)
Список pgsql-general
On 08/13/2013 12:35 PM, Michael Cronenworth wrote:
> When the client library (version 9.2.x) is compiled with a MinGW-w64 environment
> the resulting libpq.dll will not function. This has been reported previously
> with two bug reports, which have gone untouched.
>
> Bug 8151:
> http://www.postgresql.org/message-id/E1UbELM-0007NK-5L@wrigleys.postgresql.org
> Bug 8162:
> http://www.postgresql.org/message-id/E1UcLPd-0000L4-TI@wrigleys.postgresql.org
>
> I have tried compiling with every option enabled and every option disabled. Does
> anyone have any pointers or would anyone be willing to help solve this issue?

The connection problem was caused by incorrect error code checking after
connect(). The libpq interface defines a macro "SOCK_ERRNO" that on windows
calls WSAGetLastError(), which returns a Windows error code. The check after
connect() compares the Windows error code against the UNIX errno
EINPROGRRESS/EWOULDBLOCK.

I see there is a test in win32.h to see if EINPROGRESS is defined. It may not
have been defined in very old MinGW environments, but it is defined now. The
attached patches resolve the issue.

The compiled libpq.dll allows me to connect and run a SELECT and print out data.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Why doesn't COPY support the HEADER options for tab-separated output?
Следующее
От: Perry Smith
Дата:
Сообщение: Immediate Constraints