1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Oops, back out newNode changes. We are not ready for that yet.

This commit is contained in:
Bruce Momjian
2002-10-11 04:16:44 +00:00
parent 6a7bb0afbc
commit 2177b6b635
4 changed files with 20 additions and 49 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: nodes.h,v 1.119 2002/10/11 04:12:14 momjian Exp $
* $Id: nodes.h,v 1.120 2002/10/11 04:16:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -261,24 +261,6 @@ typedef struct Node
#define nodeTag(nodeptr) (((Node*)(nodeptr))->type)
/*
* There is no way to dereference the palloc'ed pointer to assign the
* tag, and return the pointer itself, so we need a holder variable.
* Fortunately, this function isn't recursive so we just define
* a global variable for this purpose.
*/
extern Node *newNodeMacroHolder;
#define newNode(size, tag) \
( \
AssertMacro((size) >= sizeof(Node)), /* need the tag, at least */ \
\
newNodeMacroHolder = (Node *) palloc0(size), \
newNodeMacroHolder->type = (tag), \
newNodeMacroHolder \
)
#define makeNode(_type_) ((_type_ *) newNode(sizeof(_type_),T_##_type_))
#define NodeSetTag(nodeptr,t) (((Node*)(nodeptr))->type = (t))
@ -300,6 +282,11 @@ extern Node *newNodeMacroHolder;
* ----------------------------------------------------------------
*/
/*
* nodes/nodes.c
*/
extern Node *newNode(Size size, NodeTag tag);
/*
* nodes/{outfuncs.c,print.c}
*/