summaryrefslogtreecommitdiff
path: root/src/include/postgres.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2012-04-29 21:07:35 +0300
committerPeter Eisentraut <peter_e@gmx.net>2012-04-29 21:20:14 +0300
commit81107282a5ff1490a0a4ded193cbc61e69cda537 (patch)
treebc39c1a3ff53655183d246fb7a6bd4da011262f0 /src/include/postgres.h
parent2227bb9c948d2dcc167d414630ed3bae7f31db83 (diff)
downloadpostgresql-81107282a5ff1490a0a4ded193cbc61e69cda537.tar.gz
Change return type of ExceptionalCondition to void and mark it noreturn
In ancient times, it was thought that this wouldn't work because of TrapMacro/AssertMacro, but changing those to use a comma operator appears to work without compiler warnings.
Diffstat (limited to 'src/include/postgres.h')
-rw-r--r--src/include/postgres.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/postgres.h b/src/include/postgres.h
index c429f291c2..94c0218cd1 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -655,14 +655,14 @@ extern PGDLLIMPORT bool assert_enabled;
/*
* TrapMacro is the same as Trap but it's intended for use in macros:
*
- * #define foo(x) (AssertMacro(x != 0) && bar(x))
+ * #define foo(x) (AssertMacro(x != 0), bar(x))
*
* Isn't CPP fun?
*/
#define TrapMacro(condition, errorType) \
((bool) ((! assert_enabled) || ! (condition) || \
(ExceptionalCondition(CppAsString(condition), (errorType), \
- __FILE__, __LINE__))))
+ __FILE__, __LINE__), 0)))
#ifndef USE_ASSERT_CHECKING
#define Assert(condition)
@@ -683,8 +683,8 @@ extern PGDLLIMPORT bool assert_enabled;
Trap(!(condition), "BadState")
#endif /* USE_ASSERT_CHECKING */
-extern int ExceptionalCondition(const char *conditionName,
+extern void ExceptionalCondition(const char *conditionName,
const char *errorType,
- const char *fileName, int lineNumber);
+ const char *fileName, int lineNumber) __attribute__((noreturn));
#endif /* POSTGRES_H */