Skip to content

Commit 0c0c7a8

Browse files
committed
Multiple include guards for origin.h
Handle repeated inclusion for origin.h and avoid redefining the RepOriginId typedef if it's already been defined by pglogical_output's compat headers. C89 doesn't allow typedef redefinition, though newer gcc is more permissive and C11 will allow it. This would break on RHEL6 but not newer platforms.
1 parent 34deff0 commit 0c0c7a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compat/replication/origin.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
#ifndef PGLOGICAL_COMPAT_REPLICATION_ORIGIN_H
2+
#define PGLOGICAL_COMPAT_REPLICATION_ORIGIN_H
3+
4+
#ifndef InvalidRepOriginId
15
typedef uint16 RepOriginId;
26
#define InvalidRepOriginId 0
7+
#endif
38

49
extern PGDLLIMPORT RepOriginId replorigin_session_origin;
510
extern PGDLLIMPORT XLogRecPtr replorigin_session_origin_lsn;
@@ -17,3 +22,5 @@ extern void replorigin_advance(RepOriginId node,
1722
XLogRecPtr remote_commit,
1823
XLogRecPtr local_commit,
1924
bool go_backward, bool wal_log);
25+
26+
#endif

0 commit comments

Comments
 (0)