Re: Visual Studio 2005, C-language function - avoiding hacks?

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: "Kevin Flanagan" <kevin-f(at)linkprior(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Visual Studio 2005, C-language function - avoiding hacks?
Date: 2010-03-08 06:05:21
Message-ID: 20100308150521.9C6B.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


"Kevin Flanagan" <kevin-f(at)linkprior(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tomas 2010-03-08 06:15:55 Re: arithmetic about inet
Previous Message Paragon Corporation 2010-03-08 04:16:50 Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL