diff -r 55d732d0fbcd src/include/executor/spi.h --- a/src/include/executor/spi.h +++ b/src/include/executor/spi.h @@ -18,6 +18,10 @@ * included postgres.h */ #include "postgres.h" + +#ifdef __cplusplus +extern "C" { +#endif /* * Most of these are not needed by this file, but may be used by @@ -156,4 +160,8 @@ extern void AtEOXact_SPI(bool isCommit); extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* SPI_H */ diff -r 55d732d0fbcd src/include/fmgr.h --- a/src/include/fmgr.h +++ b/src/include/fmgr.h @@ -17,6 +17,10 @@ */ #ifndef FMGR_H #define FMGR_H + +#ifdef __cplusplus +extern "C" { +#endif /* We don't want to include primnodes.h here, so make a stub reference */ typedef struct Node *fmNodePtr; @@ -544,4 +548,8 @@ */ extern char *fmgr(Oid procedureId,...); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* FMGR_H */ diff -r 55d732d0fbcd src/include/funcapi.h --- a/src/include/funcapi.h +++ b/src/include/funcapi.h @@ -16,11 +16,14 @@ #ifndef FUNCAPI_H #define FUNCAPI_H +#ifdef __cplusplus +extern "C" { +#endif + #include "fmgr.h" #include "access/tupdesc.h" #include "executor/executor.h" #include "executor/tuptable.h" - /*------------------------------------------------------------------------- * Support to ease writing Functions returning composite types @@ -299,4 +302,8 @@ PG_RETURN_NULL(); \ } while (0) +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* FUNCAPI_H */ diff -r 55d732d0fbcd src/include/postgres.h --- a/src/include/postgres.h +++ b/src/include/postgres.h @@ -44,7 +44,12 @@ #ifndef POSTGRES_H #define POSTGRES_H +#ifdef __cplusplus +extern "C" { +#endif + #include "c.h" + #include "utils/elog.h" #include "utils/palloc.h" @@ -693,4 +698,8 @@ const char *errorType, const char *fileName, int lineNumber); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* POSTGRES_H */