Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 324435e

Browse files
committed
Prevent compilation of frontend-only files in src/common/ with backend
Any frontend-only file of src/common/ should include a protection to prevent such code to be included in the backend compilation. fe_memutils.c and restricted_token.c have been doing that, while file_utils.c (since bf5bb2e) and logging.c (since fc9a62a) forgot it. Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/20200625080757.GI130132@paquier.xyz
1 parent ee0202d commit 324435e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/common/file_utils.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
15+
16+
#ifndef FRONTEND
17+
#error "This file is not expected to be compiled for backend code"
18+
#endif
19+
1520
#include "postgres_fe.h"
1621

1722
#include <dirent.h>

src/common/logging.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
*
88
*-------------------------------------------------------------------------
99
*/
10+
11+
#ifndef FRONTEND
12+
#error "This file is not expected to be compiled for backend code"
13+
#endif
14+
1015
#include "postgres_fe.h"
1116

1217
#include <unistd.h>

0 commit comments

Comments
 (0)