PostgreSQL Source Code git master
Loading...
Searching...
No Matches
test_cplusplusext.cpp File Reference
#include "postgres.h"
#include "fmgr.h"
#include "nodes/pg_list.h"
#include "nodes/primnodes.h"
Include dependency graph for test_cplusplusext.cpp:

Go to the source code of this file.

Functions

 PG_FUNCTION_INFO_V1 (test_cplusplus_add)
 
 StaticAssertDecl (sizeof(int32)==4, "int32 should be 4 bytes")
 
Datum test_cplusplus_add (PG_FUNCTION_ARGS)
 

Variables

 PG_MODULE_MAGIC
 

Function Documentation

◆ PG_FUNCTION_INFO_V1()

PG_FUNCTION_INFO_V1 ( test_cplusplus_add  )

◆ StaticAssertDecl()

StaticAssertDecl ( sizeof(int32 = =4,
"int32 should be 4 bytes"   
)

◆ test_cplusplus_add()

Datum test_cplusplus_add ( PG_FUNCTION_ARGS  )

Definition at line 35 of file test_cplusplusext.cpp.

36{
41 List *list = list_make1(node);
42
44 {
45 (void) rtr;
46 }
47
49 {
50 (void) rtr;
51 }
52
53 StaticAssertStmt(sizeof(int32) == 4, "int32 should be 4 bytes");
54 (void) StaticAssertExpr(sizeof(int64) == 8, "int64 should be 8 bytes");
55
56 list_free(list);
57 pfree(node);
58 pfree(copy);
59
60 switch (a)
61 {
62 case 1:
63 elog(DEBUG1, "1");
65 case 2:
66 elog(DEBUG1, "2");
67 break;
68 }
69
71}
#define StaticAssertExpr(condition, errmessage)
Definition c.h:993
int64_t int64
Definition c.h:576
int32_t int32
Definition c.h:575
#define pg_fallthrough
Definition c.h:144
#define StaticAssertStmt(condition, errmessage)
Definition c.h:978
#define DEBUG1
Definition elog.h:30
#define elog(elevel,...)
Definition elog.h:226
#define PG_RETURN_INT32(x)
Definition fmgr.h:355
#define PG_GETARG_INT32(n)
Definition fmgr.h:269
int b
Definition isn.c:74
int a
Definition isn.c:73
void list_free(List *list)
Definition list.c:1546
void pfree(void *pointer)
Definition mcxt.c:1616
#define copyObject(obj)
Definition nodes.h:232
#define makeNode(_type_)
Definition nodes.h:161
#define list_make1(x1)
Definition pg_list.h:212
#define foreach_ptr(type, var, lst)
Definition pg_list.h:469
#define foreach_node(type, var, lst)
Definition pg_list.h:496
static int fb(int x)
Definition pg_list.h:54

References a, b, copyObject, DEBUG1, elog, fb(), foreach_node, foreach_ptr, list_free(), list_make1, makeNode, pfree(), pg_fallthrough, PG_GETARG_INT32, PG_RETURN_INT32, StaticAssertExpr, and StaticAssertStmt.

Variable Documentation

◆ PG_MODULE_MAGIC

PG_MODULE_MAGIC

Definition at line 23 of file test_cplusplusext.cpp.