Skip to content

Commit bf7427b

Browse files
committed
Minimal portability fix for commit e1551f9.
Older gcc versions are not happy with having multiple declarations for the same typedef name (not struct name). I'm a bit dubious as to how well-thought-out that patch was at all, but for the moment just fix it enough so I can get some work done today. Discussion: https://postgr.es/m/20191218101338.GB325369@paquier.xyz
1 parent ecb09cd commit bf7427b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/include/parser/parse_utilcmd.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
#include "parser/parse_node.h"
1818

19-
typedef struct AttrMap AttrMap;
19+
struct AttrMap; /* avoid including attmap.h here */
20+
2021

2122
extern List *transformCreateStmt(CreateStmt *stmt, const char *queryString);
2223
extern List *transformAlterTableStmt(Oid relid, AlterTableStmt *stmt,
@@ -30,7 +31,7 @@ extern PartitionBoundSpec *transformPartitionBound(ParseState *pstate, Relation
3031
PartitionBoundSpec *spec);
3132
extern IndexStmt *generateClonedIndexStmt(RangeVar *heapRel,
3233
Relation source_idx,
33-
const AttrMap *attmap,
34+
const struct AttrMap *attmap,
3435
Oid *constraintOid);
3536

3637
#endif /* PARSE_UTILCMD_H */

src/include/rewrite/rewriteManip.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
#include "nodes/parsenodes.h"
1818

19+
struct AttrMap; /* avoid including attmap.h here */
20+
1921

20-
typedef struct AttrMap AttrMap;
2122
typedef struct replace_rte_variables_context replace_rte_variables_context;
2223

2324
typedef Node *(*replace_rte_variables_callback) (Var *var,
@@ -72,7 +73,7 @@ extern Node *replace_rte_variables_mutator(Node *node,
7273

7374
extern Node *map_variable_attnos(Node *node,
7475
int target_varno, int sublevels_up,
75-
const AttrMap *attno_map,
76+
const struct AttrMap *attno_map,
7677
Oid to_rowtype, bool *found_whole_row);
7778

7879
extern Node *ReplaceVarsFromTargetList(Node *node,

0 commit comments

Comments
 (0)