diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index ed95474b3f..0834ae6e06 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -34,8 +34,6 @@ #include "regex/regguts.h" -#include "miscadmin.h" /* needed by rcancelrequested/rstacktoodeep */ - /* * forward declarations, up here so forward datatypes etc. are defined early */ diff --git a/src/include/regex/regcustom.h b/src/include/regex/regcustom.h index 04a1893c80..82c9e2fad8 100644 --- a/src/include/regex/regcustom.h +++ b/src/include/regex/regcustom.h @@ -29,6 +29,13 @@ */ /* headers if any */ + +/* + * It's against Postgres coding conventions to include postgres.h in a + * header file, but we allow the violation here because the regexp library + * files specifically intend this file to supply application-dependent + * headers, and are careful to include this file before anything else. + */ #include "postgres.h" #include @@ -47,6 +54,8 @@ #include "mb/pg_wchar.h" +#include "miscadmin.h" /* needed by rcancelrequested/rstacktoodeep */ + /* overrides for regguts.h definitions, if any */ #define FUNCPTR(name, args) (*name) args diff --git a/src/include/snowball/header.h b/src/include/snowball/header.h index 9501f77ac1..d8be02ee60 100644 --- a/src/include/snowball/header.h +++ b/src/include/snowball/header.h @@ -22,6 +22,11 @@ #ifndef SNOWBALL_HEADR_H #define SNOWBALL_HEADR_H +/* + * It's against Postgres coding conventions to include postgres.h in a + * header file, but we allow the violation here because the alternative is + * to modify the machine-generated .c files provided by the Snowball project. + */ #include "postgres.h" /* Some platforms define MAXINT and/or MININT, causing conflicts */