Re: [COMMITTERS] pgsql: PGDLLEXPORT is __declspec (dllexport) only on MSVC, but is

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: PGDLLEXPORT is __declspec (dllexport) only on MSVC, but is
Date: 2010-06-01 21:52:57
Message-ID: 4C058139.8020801@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

井上です。
ご苦労様です。

このスレッド気になっていたのですが、ようやく少し
余裕ができたのでテストなどしてみました。

Takahiro Itagaki wrote:
> Log Message:
> -----------
> PGDLLEXPORT is __declspec (dllexport) only on MSVC,
> but is __declspec (dllimport) on other compilers

私が知る限りdlimportがexportの引きがねになることは
ないのでこの部分にはかなり違和感を感じていました。
実際__declspec(..)をすっぱり取り除いてmingwでbuild
してみましたが少なくともinitdbでエラーになることは
ありません。この場合の__declspec(dllimport)指定は
意味があるようには思えませんし運よく害がないだけだ
という気がします。

> because cygwin and mingw don't like dllexport.

一方__declspec(dllexport)指定は運悪く害があるのです
が原因は単純ではなさそうです。エラーが発生している
場所はLoadLibrary()でありGetProcAddress()ではない
ので関数がexportされないという原因ではなさそうです。
ネットを見て回ったところではdllwrap(及び?dlltool)
を使っているのがまずいのかなという感触はありますが
明確な所はわかりません。又、それを避けるにはどうし
たらよいのかがわかるほどmingwに詳しくはありません。

以上 参考まで

> Modified Files:
> --------------
> pgsql/src/include/port:
> cygwin.h (r1.8 -> r1.9)
> (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/port/cygwin.h?r1=1.8&r2=1.9)
> win32.h (r1.94 -> r1.95)
> (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/port/win32.h?r1=1.94&r2=1.95)

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-06-02 09:28:44 pgsql: Fix obsolete comments that I neglected to update in a previous
Previous Message Bruce Momjian 2010-06-01 13:43:39 pgsql: Update C++ release note item wording.

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-06-01 22:04:41 Re: is_absolute_path incorrect on Windows
Previous Message Merlin Moncure 2010-06-01 21:22:39 Re: [RFC] A tackle to the leaky VIEWs for RLS