Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buIw0-0002w1-K9 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Oct 2016 12:47:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1buIw0-00015H-6r for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Oct 2016 12:47:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1buIuc-00071g-BR for pgsql-hackers@postgreSQL.org; Wed, 12 Oct 2016 12:45:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1buIuZ-0001dj-7r for pgsql-hackers@postgreSQL.org; Wed, 12 Oct 2016 12:45:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u9CCjTWq005587; Wed, 12 Oct 2016 08:45:29 -0400 From: Tom Lane To: Albe Laurenz cc: pgsql-hackers@postgreSQL.org Subject: Re: Add PGDLLEXPORT to PG_FUNCTION_INFO_V1 In-reply-to: References: Comments: In-reply-to Albe Laurenz message dated "Wed, 12 Oct 2016 09:09:05 -0000" Date: Wed, 12 Oct 2016 08:45:29 -0400 Message-ID: <5586.1476276329@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Albe Laurenz writes: > Currently, PG_FUNCTION_INFO_V1 is defined as > /* > * Macro to build an info function associated with the given function name. > * Win32 loadable functions usually link with 'dlltool --export-all', but it > * doesn't hurt to add PGDLLIMPORT in case they don't. > */ > #define PG_FUNCTION_INFO_V1(funcname) \ > Datum funcname(PG_FUNCTION_ARGS); \ > extern PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \ > const Pg_finfo_record * \ > CppConcat(pg_finfo_,funcname) (void) \ > { \ > static const Pg_finfo_record my_finfo = { 1 }; \ > return &my_finfo; \ > } \ > extern int no_such_variable > Is there a good reason why the "funcname" declaration is not decorated > with PGDLLEXPORT? The lack of complaints about this suggest that it's not actually necessary to do so. So what this makes me wonder is whether we can't drop the DLLEXPORT on the finfo function too. I'd rather reduce the number of Microsoft-isms in the code, not increase it. > BTW, I admit I don't understand the comment. It seems like an obvious typo. Or, possibly, sloppy thinking that contributed to failure to recognize that the keyword isn't needed. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers