define bool in pgtypeslib_extern.h

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема define bool in pgtypeslib_extern.h
Дата
Msg-id CAA4eK1LmaKO7Du9M9Lo=kxGU8sB6aL8fa3sF6z6d5yYYVe3BuQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: define bool in pgtypeslib_extern.h
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Victor Spirin
Дата:
Сообщение: Re: psql tab-complete
Следующее
От: Surafel Temesgen
Дата:
Сообщение: Re: WIP: System Versioned Temporal Table