Re: Create function prototype as part of PG_FUNCTION_INFO_V1 - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Create function prototype as part of PG_FUNCTION_INFO_V1
Date
Msg-id 534DF9EB.9000108@gmx.net
Whole thread Raw
In response to Re: Create function prototype as part of PG_FUNCTION_INFO_V1  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Create function prototype as part of PG_FUNCTION_INFO_V1
List pgsql-hackers
On 4/14/14, 3:28 PM, Peter Eisentraut wrote:
> On 4/4/14, 10:07 AM, Andres Freund wrote:
>> If
>> somebody previously tried to do the correct thing and attached
>> PGDLLEXPORT to their own *function* prototoype, it would cause problems
>> now.
> 
> What is the difference (on affected platforms) between
> 
> Datum funcname(PG_FUNCTION_ARGS);
> 
> and writing (effectively)
> 
> PGDLLEXPORT Datum funcname(PG_FUNCTION_ARGS);
> Datum funcname(PG_FUNCTION_ARGS);
> 
> or for that matter
> 
> Datum funcname(PG_FUNCTION_ARGS);
> PGDLLEXPORT Datum funcname(PG_FUNCTION_ARGS);
> 
> 
> If there isn't a difference, then my patch is fine.  Otherwise, it might
> be good to document the issues for extension authors.

Let me point out again that my patch doesn't actually do anything about
PGDLLEXPORT or the like.  It just adds automatic prototypes into
PG_FUNCTION_INFO_V1, to reduce compiler warnings in extensions and
reduce some boilerplate in general.

If it turns out that this might help someone optimize the Windows build,
then great.  But I gather it won't, so so what.  Or maybe it can be made
to work, in which case extension authors will get compiler errors about
places they need to clean up.  So it could still help that way, but who
knows, that's not the point.

If there are still concerns in this area, we could commit just the part
that adds the prototype to PG_FUNCTION_INFO_V1 and let that sit for a
while, and then remove the (now redundant) explicit prototypes in a
later release, so if there is a need to revert it, it won't be so big.




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [COMMITTERS] pgsql: Add TAP tests for client programs
Next
From: Amit Langote
Date:
Subject: [doc] EXPLAIN CREATE MATERIALIZED VIEW AS?