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

From Kyotaro HORIGUCHI
Subject Re: Retain dynamic shared memory segments for postmaster lifetime
Date
Msg-id 20140204.155509.07674685.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: Retain dynamic shared memory segments for postmaster lifetime  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Retain dynamic shared memory segments for postmaster lifetime
List pgsql-hackers
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...

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.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Row-security on updatable s.b. views
Next
From: Tom Lane
Date:
Subject: Re: could not create IPv6 socket (AI_ADDRCONFIG)