define bool in pgtypeslib_extern.h
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Andrew Gierth <andrew@tao11.riddles.org.uk>
Date: 2019-10-25T09:48:37Z
Lists: pgsql-hackers
Today, I committed a patch (dddf4cdc) to reorder some of the file header inclusions and buildfarm members prairiedog and locust failed as a result of that. The reason turns out to be that we have defined a bool in pgtypeslib_extern.h and that definition is different from what we define in c.h. c.h defines it as: #ifndef bool typedef unsigned char bool; #endif pgtypeslib_extern.h defines it as: #ifndef bool #define bool char #endif Prior to dddf4cdc, pgtypeslib_extern.h was included as a first header before any usage of bool, but commit moves it after dt.h in file dt_common.c. Now, it seems like dt.h was using a version of bool as defined in c.h and dt_common.c uses as defined by pgtypeslib_extern.h which leads to some compilation errors as below: dt_common.c:672: error: conflicting types for 'EncodeDateOnly' dt.h:321: error: previous declaration of 'EncodeDateOnly' was here dt_common.c:756: error: conflicting types for 'EncodeDateTime' dt.h:316: error: previous declaration of 'EncodeDateTime' was here dt_common.c:1783: error: conflicting types for 'DecodeDateTime' dt.h:324: error: previous declaration of 'DecodeDateTime' was here make[4]: *** [dt_common.o] Error 1 As suggested by Andrew Gierth [1], I think we can remove the define in pgtypeslib_extern.h as it doesn't seem to be exposed. Thoughts? Note - For the time being, I have changed the order of file inclusions (c114229ca2) in dt_common.c as it was before so that the buildfarm becomes green again. [1] - https://www.postgresql.org/message-id/87h83xmg4m.fsf%40news-spur.riddles.org.uk -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
Commits
-
Fix ecpglib.h to declare bool consistently with c.h.
- 7a0574b50ee9 13.0 landed
-
Move declaration of ecpg_gettext() to a saner place.
- c8cb98ec41f0 13.0 landed
- baa483984fde 9.6.16 landed
- b705d639146c 9.5.20 landed
- b20233aac743 9.4.25 landed
- 89f56fc223f9 11.6 landed
- 831ca9513c59 10.11 landed
- 101654987344 12.1 landed
-
Sync our DTrace infrastructure with c.h's definition of type bool.
- d4d0cd6ee23e 12.1 landed
- ff43b3e88ece 13.0 landed
-
Get rid of useless/dangerous redefinition of bool in ECPG.
- 4a61aa4a945f 12.1 landed
- 1408d5d86992 13.0 landed