Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mrYjx-0000fi-4g for pgsql-committers@arkaria.postgresql.org; Mon, 29 Nov 2021 04:58:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mrYjv-0003b8-MZ for pgsql-committers@arkaria.postgresql.org; Mon, 29 Nov 2021 04:58:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mrYjv-0003az-FP for pgsql-committers@lists.postgresql.org; Mon, 29 Nov 2021 04:58:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mrYjp-0002q2-2K for pgsql-committers@lists.postgresql.org; Mon, 29 Nov 2021 04:58:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1AT4vwIT1140658; Sun, 28 Nov 2021 23:57:58 -0500 From: Tom Lane To: Andrew Dunstan cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Replace random(), pg_erand48(), etc with a better PRNG API and a In-reply-to: <1135295.1638157668@sss.pgh.pa.us> References: <1135295.1638157668@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 28 Nov 2021 22:47:48 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1140656.1638161878.1@sss.pgh.pa.us> Date: Sun, 28 Nov 2021 23:57:58 -0500 Message-ID: <1140657.1638161878@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > ... If so, we could perhaps > fix it by doing > #ifdef FRONTEND > extern pg_prng_state pg_global_prng_state; > #else > extern PGDLLIMPORT pg_prng_state pg_global_prng_state; > #endif Ah, I now see the same hack being used in keywords.h and pg_bitutils.h, so I'll go do that. (Maybe we should invent a variant of PGDLLIMPORT that can make this happen without as much code duplication?) regards, tom lane