Re: Linking PostgreSQL as a C++ program

Поиск
Список
Период
Сортировка
Искать
От
Craig Ringer
Тема
Re: Linking PostgreSQL as a C++ program
Дата
Msg-id
CAMsr+YG2DQLiP4EmjXHPhRTBOgXm5neK9ErzcxmtsGFaaVT1Qg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Linking PostgreSQL as a C++ program Craig Ringer <craig@2ndquadrant.com>
Re: Linking PostgreSQL as a C++ program Michael Paquier <michael.paquier@gmail.com>
Re: Linking PostgreSQL as a C++ program Craig Ringer <craig@2ndquadrant.com>
On 29 January 2018 at 18:02, Michael Paquier <michael.paquier@gmail.com> wrote:
On Mon, Jan 29, 2018 at 05:46:54PM +1300, Craig Ringer wrote:
> extern "C" {
> #include "postgres.h"
> }

Don't you need __cplusplus as well? More or less that:

#ifdef __cplusplus
extern "C" {
#endif
#include "postgres.h"
#ifdef __cplusplus
}
#endif

For headers used by both C and C++ code, yes.

For C++ sources, no. 



--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления
От: Masahiko Sawada
Дата:
От: Yuto Hayamizu
Дата:
FAQ