Re: How to include the header files effectively - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: How to include the header files effectively
Date
Msg-id 20190412043110.GK2144@paquier.xyz
Whole thread Raw
In response to Re: How to include the header files effectively  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Thu, Apr 11, 2019 at 10:22:56PM -0400, Alvaro Herrera wrote:
> What are you trying to do?  Your .c file must include "postgres.h"
> before any other header file.  There should be no other dependencies.

The usual rule when it comes to develop extensions or a patch is to
include headers in the following order:
1) postgres.h for backend code and postgres_fe.h for frontend (use
ifdef FRONTEND if a file is used in both context, see src/common/*.c).
2) System-related headers, like <unistd.h> or such.
3) Other PostgreSQL internal headers, in any patch posted to the lists
these in alphabetical order is warmly welcome.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Attempt to consolidate reading of XLOG page
Next
From: Michael Paquier
Date:
Subject: Re: Adding Unix domain socket path and port topg_stat_get_wal_senders()