I wrote:
> But I'd understand if you think that this is too much code churn for too little
> benefit, even if it could be considered a clean-up.
>
> In that case, I'd argue that in the sample in doc/src/sgml/xfunc.sgml
> the function definitions should be changed to read
>
> PGDLLEXPORT Datum foo(PG_FUNCTION_ARGS)
>
> instead of
>
> Datum foo(PG_FUNCTION_ARGS)
>
> because without that the sample fails if you try to build it with MSVC
> like the stackoverflow question did.
Since I didn't hear from you, I assume that you are not in favour of
removing the SQL function declarations from contrib.
So I went ahead and wrote a patch to add PGDLLEXPORT to the C function sample.
While at it, I noticed that there are no instructions for building and
linking C functions with MSVC, so I have added a patch for that as well.
Yours,
Laurenz Albe