Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iORkO-0000Ng-2E for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Oct 2019 19:29:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iORkM-0003e8-Fx for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Oct 2019 19:29:10 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iORkM-0003dx-6x for pgsql-hackers@lists.postgresql.org; Sat, 26 Oct 2019 19:29:10 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iORkJ-0004D9-Q9; Sat, 26 Oct 2019 19:29:09 +0000 Received: from [192.168.127.1] (port=17272 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1iORkF-0000p9-LJ; Sat, 26 Oct 2019 19:29:03 +0000 Received: from localhost ([127.0.0.1]:28288 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1iORkF-0002sF-FN; Sat, 26 Oct 2019 19:29:03 +0000 From: Andrew Gierth To: Tom Lane Cc: Amit Kapila , PostgreSQL Hackers , Michael Meskes Subject: Re: define bool in pgtypeslib_extern.h In-Reply-To: <32373.1572110364@sss.pgh.pa.us> (Tom Lane's message of "Sat, 26 Oct 2019 13:19:24 -0400") Message-ID: <877e4rmi2y.fsf@news-spur.riddles.org.uk> References: <16583.1572010913@sss.pgh.pa.us> <18578.1572020755@sss.pgh.pa.us> <32373.1572110364@sss.pgh.pa.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (berkeley-unix) Date: Sat, 26 Oct 2019 20:29:03 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Tom" == Tom Lane writes: Tom> On closer inspection, it seems to be just blind luck. For example, Tom> if I rearrange the inclusion order in a file using ecpglib.h: Ugh. Tom> I'm inclined to think that we need to make ecpglib.h's Tom> bool-related definitions exactly match c.h, I'm wondering whether we should actually go the opposite way and say that c.h's "bool" definition should be backend only, and that in frontend code we should define a PG_bool type or something of that ilk for when we want "PG's 1-byte bool" and otherwise let the platform define "bool" however it wants. And we certainly shouldn't be defining "bool" in something that's going to be included in the user's code the way that ecpglib.h is. -- Andrew.