rename and move AssertVariableIsOfType - Mailing list pgsql-hackers

From Peter Eisentraut
Subject rename and move AssertVariableIsOfType
Date
Msg-id 2273bc2a-045d-4a75-8584-7cd9396e5534@eisentraut.org
Whole thread Raw
Responses Re: rename and move AssertVariableIsOfType
List pgsql-hackers
I'm proposing two changes:

First, rename AssertVariableIsOfType to StaticAssertVariableIsOfType. 
The current name suggests that it is a run-time assertion (like 
"Assert"), but it's not.  The name change makes that clearer.

I doubt that the current name is used in many extensions, but if 
necessary, extension code could adapt to this quite easily with 
something like

#if PG_VERSION_NUM < ...
#define StaticAssertVariableIsOfType(x, y) AssertVariableIsOfType(x, y)
#endif

Second, change the underlying implementation of 
StaticAssertVariableIsOfType to use StaticAssertDecl instead of 
StaticAssertStmt.  This makes StaticAssertVariableIsOfType behave more 
like a normal static assertion, and in many cases we can move the 
current instances to a more natural position at file scope.  This is 
similar to previous commits like 493eb0da31b.

Attachment

pgsql-hackers by date:

Previous
From: Zsolt Parragi
Date:
Subject: Re: [oauth] Stabilize the libpq-oauth ABI (and allow alternative implementations?)
Next
From: Peter Eisentraut
Date:
Subject: Re: AIX support