Re: How to include the header files effectively

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: How to include the header files effectively
Дата
Msg-id 20190412022256.GA32225@alvherre.pgsql
обсуждение исходный текст
Ответ на How to include the header files effectively  (Andy Fan <zhihui.fan1213@gmail.com>)
Ответы Re: How to include the header files effectively  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 2019-Apr-12, Andy Fan wrote:

> for example,  when I want the LOCKTAG in .c file,   which is defined in
> "storage/lock.h".  then I wrote the code like this:
> 
> #include "storage/lock.h"
> ...
> 
> /../../../src/include/storage/lockdefs.h:50:2: error: unknown type name
>       'TransactionId'
>         TransactionId xid;                      /* xid of holder of AccessExclusiveLock */

What are you trying to do?  Your .c file must include "postgres.h"
before any other header file.  There should be no other dependencies.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to include the header files effectively
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: Should we add GUCs to allow partition pruning to be disabled?