Re: Retain dynamic shared memory segments for postmaster lifetime - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Retain dynamic shared memory segments for postmaster lifetime
Date
Msg-id CAA4eK1K0=WJs4JiUFTuDOwMCd+R1fw+yYaUG==LosozZvYB01g@mail.gmail.com
Whole thread Raw
In response to Re: Retain dynamic shared memory segments for postmaster lifetime  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: Retain dynamic shared memory segments for postmaster lifetime
Re: Retain dynamic shared memory segments for postmaster lifetime
List pgsql-hackers
On Tue, Feb 4, 2014 at 12:25 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:
> Hello, Now I got workable dll thanks for your advice.
>
>> I think both the problems are related and the reason is that dsm_demo.dll
>> is not built properly.
>> Let us first try to solve your second problem, because I think if
>> that is solved, you will not face problem-1.
>
> Thank you for kindness. I got the situation after successfully
> getting correct dll by using .def file after your advice.  cl
> needs __declspec(dllexport) in the symbol definitions to reveal
> them externally, without using .def file.
>
> PostgreSQL platform(?) seems offering a macro PGDLLEXPORT for
> such use. I suppose this should be used in extension module dlls
> to expose symbols, like this,
>
> - void  _PG_init(void);
> - Datum dsm_demo_create(PG_FUNCTION_ARGS);
> - Datum dsm_demo_read(PG_FUNCTION_ARGS);
> ===
> + PGDLLEXPORT void      _PG_init(void);
> + PGDLLEXPORT Datum     dsm_demo_create(PG_FUNCTION_ARGS);
> + PGDLLEXPORT Datum     dsm_demo_read(PG_FUNCTION_ARGS);
>
> # This hardly seems to be used commonly...

Yeah, for functions we mainly believe to export using .def file
only and so is the case for this module.
Anyway this is just a test module so if things works for you by
changing the above way, its fine. However I wonder why its not
generating .def file for you.
>
> I followed this instruction to make build environemnt,
>
> http://blog.2ndquadrant.com/compiling-postgresql-extensions-visual-studio-windows/
>
> And the change above enables us to build this module without .def file.

Okay, you can complete your test in the way with which you are able to
successfully build it.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Row-security on updatable s.b. views
Next
From: Amit Kapila
Date:
Subject: Re: narwhal and PGDLLIMPORT