From 1c382655ad90b7cd224230452f7056040337facf Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Fri, 14 Dec 2012 18:03:07 -0500 Subject: Provide Assert() for frontend code. Per discussion on-hackers. psql is converted to use the new code. Follows a suggestion from Heikki Linnakangas. --- src/include/postgres_fe.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/include/postgres_fe.h') diff --git a/src/include/postgres_fe.h b/src/include/postgres_fe.h index fcfbd31d35c..8fd580fbf75 100644 --- a/src/include/postgres_fe.h +++ b/src/include/postgres_fe.h @@ -24,4 +24,16 @@ #include "c.h" +/* + * Assert() can be used in both frontend and backend code. In frontend code it + * just calls the standard assert, if it's available. If use of assertions is + * not configured, it does nothing. + */ +#ifdef USE_ASSERT_CHECKING +#include +#define Assert(p) assert(p) +#else +#define Assert(p) +#endif + #endif /* POSTGRES_FE_H */ -- cgit v1.2.3