Re: Visual Studio 2005, C-language function - avoiding hacks? - Mailing list pgsql-hackers

From Takahiro Itagaki
Subject Re: Visual Studio 2005, C-language function - avoiding hacks?
Date
Msg-id 20100308150521.9C6B.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: Visual Studio 2005, C-language function - avoiding hacks?  ("Kevin Flanagan" <kevin-f@linkprior.com>)
Responses Re: Visual Studio 2005, C-language function - avoiding hacks?
List pgsql-hackers
"Kevin Flanagan" <kevin-f@linkprior.com> wrote:

> 1. you have to define the symbol BUILDING_DLL in your code before
> including postgres.h

No, BUILDING_DLL does not work. We use PGDLLIMPORT both exported global
variables and PG_MODULE_MAGIC/PG_FUNCTION_INFO_V1 for now, but actually
we should always use __declspec (dllexport) for the latter cases.
They are exported from *user dlls*, not the postgres' one.

I'd like to propose to define PGALWAYSEXPORT macro:   #ifdef WIN32   #define PGALWAYSEXPORT  __declspec (dllexport)
#endif
and modify PG_MODULE_MAGIC and PG_FUNCTION_INFO_V1 to use it
instead of PGDLLEXPORT.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: fanng yuan
Date:
Subject: arithmetic about inet
Next
From: tomas@tuxteam.de
Date:
Subject: Re: arithmetic about inet