Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

Поиск
Список
Период
Сортировка
От Lars Kanis
Тема Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64
Дата
Msg-id 3782366.IDImt4Siyk@c1170lx
обсуждение исходный текст
Ответ на Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64  (NISHIYAMA Tomoaki <tomoakin@staff.kanazawa-u.ac.jp>)
Ответы Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64
Список pgsql-hackers
> Isn't it better to check the value of macros itsef rather than checking for
> system dependent macros that does not directly relate to the issue?
> specifically for getaddrinfo.c case I think
> #if EAI_NODATA != EAI_NONAME
> is a better check than checking for
> #if !defined(__MINGW64_VERSION_MAJOR) && !defined(WIN32_ONLY_COMPILER)    /* MSVC/WIN64 duplicate */
Yes it's better and it works for all described test environments.

> For the win32.h, I really don't understand why _WINSOCKAPI_ was defined before
> <winsock2.h>
> some google suggests that defining _WINSOCKAPI_ before <windows.h> prevents
> inclusion of winsock.h but that does not have relation to inclusion of
> <winsock2.h> and if <winsock2.h> is included first, it should be ok.
>
> If this guess is right, perhaps it could be better to remove the three lines.
> #if !defined(WIN64) || defined(WIN32_ONLY_COMPILER)
> #define _WINSOCKAPI_
> #endif
I only changed this for consistency. For me, it works without that define in all test
environments, too.

> +/* __MINGW64_VERSION_MAJOR is related to both 32/64 bit gcc compiles by
> + * mingw-w64, however it gots defined only after
> Why not use __MINGW32__, which is defined without including any headers?

At least in mingw32 v4.4.4 there is no crtdefs.h. I couldn't find a proper define that relates directly
to that issue, so attached is a somewhat cumbersome MINGW version check.

--
Regards,
Lars Kanis

Вложения

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

Предыдущее
От: Florian Weimer
Дата:
Сообщение: Re: Making TEXT NUL-transparent
Следующее
От: Alexander Shulgin
Дата:
Сообщение: Re: Making TEXT NUL-transparent