pgsql: PGDLLEXPORT is __declspec (dllexport) only on MSVC, but is
Log Message:
-----------
PGDLLEXPORT is __declspec (dllexport) only on MSVC,
but is __declspec (dllimport) on other compilers
because cygwin and mingw don't like dllexport.
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)
itagaki@postgresql.org (Takahiro Itagaki) writes:
Log Message:
-----------
PGDLLEXPORT is __declspec (dllexport) only on MSVC,
but is __declspec (dllimport) on other compilers
because cygwin and mingw don't like dllexport.
That probably explains why the code was the way it was before ...
regards, tom lane
井上です。
ご苦労様です。
このスレッド気になっていたのですが、ようやく少し
余裕ができたのでテストなどしてみました。
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に詳しくはありません。
以上 参考まで
Show quoted text
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)