1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Provide Assert() for frontend code.

Per discussion on-hackers. psql is converted to use the new code.

Follows a suggestion from Heikki Linnakangas.
This commit is contained in:
Andrew Dunstan
2012-12-14 18:03:07 -05:00
parent 75758a6ff0
commit 1c382655ad
7 changed files with 30 additions and 25 deletions

View File

@@ -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 <assert.h>
#define Assert(p) assert(p)
#else
#define Assert(p)
#endif
#endif /* POSTGRES_FE_H */