PostgreSQL Source Code git master
Loading...
Searching...
No Matches
test_cplusplusext.cpp
Go to the documentation of this file.
1/*--------------------------------------------------------------------------
2 *
3 * test_cplusplusext.cpp
4 * Test that PostgreSQL headers compile with a C++ compiler.
5 *
6 * This file is compiled with a C++ compiler to verify that PostgreSQL
7 * headers remain compatible with C++ extensions.
8 *
9 * Copyright (c) 2025-2026, PostgreSQL Global Development Group
10 *
11 * IDENTIFICATION
12 * src/test/modules/test_cplusplusext/test_cplusplusext.cpp
13 *
14 * -------------------------------------------------------------------------
15 */
16
17extern "C" {
18#include "postgres.h"
19#include "fmgr.h"
20
22
24}
25
26/*
27 * Simple function that returns the sum of two integers. This verifies that
28 * C++ extension modules can be loaded and called correctly at runtime.
29 */
30extern "C" Datum
int32_t int32
Definition c.h:542
#define PG_FUNCTION_INFO_V1(funcname)
Definition fmgr.h:417
#define PG_RETURN_INT32(x)
Definition fmgr.h:355
#define PG_GETARG_INT32(n)
Definition fmgr.h:269
#define PG_FUNCTION_ARGS
Definition fmgr.h:193
int b
Definition isn.c:74
int a
Definition isn.c:73
uint64_t Datum
Definition postgres.h:70
PG_MODULE_MAGIC
Datum test_cplusplus_add(PG_FUNCTION_ARGS)