Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7184a42

Browse files
committed
The small context diff below corrects what seems to be an oversight in
fmgr.h - it's discouraged to access fcinfo directly but there is nomacro to get the number of arguments passed to the function. Checkingthe number of arguments is often useful when you have a function whichcan be called like: func('arg'); func(null); func();all mapping to the same C function.the macro has a function-like appearance to match the other PG_*macros.Lee Kindness.
1 parente57ab04 commit7184a42

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/include/fmgr.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $Id: fmgr.h,v 1.24 2002/09/04 20:31:36 momjian Exp $
14+
* $Id: fmgr.h,v 1.25 2002/09/12 00:26:42 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -115,6 +115,11 @@ extern void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo,
115115
/* Standard parameter list for fmgr-compatible functions */
116116
#definePG_FUNCTION_ARGSFunctionCallInfo fcinfo
117117

118+
/*
119+
* Get number of arguments passed to function.
120+
*/
121+
#definePG_NARGS() (fcinfo->nargs)
122+
118123
/*
119124
* If function is not marked "proisstrict" in pg_proc, it must check for
120125
* null arguments using this macro. Do not try to GETARG a null argument!

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp