rename and move AssertVariableIsOfType

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема rename and move AssertVariableIsOfType
Дата
Msg-id 2273bc2a-045d-4a75-8584-7cd9396e5534@eisentraut.org
обсуждение исходный текст
Ответы Re: rename and move AssertVariableIsOfType
Список 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.

Вложения

В списке pgsql-hackers по дате отправления: