The following bug has been logged online:
Bug reference: 5394
Logged by: Vladimir Barzionov
Email address: snego.barsik@gmail.com
PostgreSQL version: 8.3.10
Operating system: win32
Description: invalid __declspec for PG_MODULE_MAGIC
Details:
In fmgr.h,
macros PG_MODULE_MAGIC, PG_FUNCTION_INFO_V1.. are declared with incorrect
"storage-class". It uses PGDLLIMPORT for declare __declspec().
In general for building external DLL module, PGDLLIMPORT must be
__declspec(dllimport). As it is.
However in PG_MAGIC_* macro, storage class for function must be
__declspec(dllexport).
Same problem was already discussed for example here
http://dbaspot.com/forums/postgresql/393683-re-general-custom-c-function-pal
loc-broken.html
Looks like the simplest way for correcting the issue is declaring additional
macro (something like PGMODULEEXPORT)