summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2022-11-03 15:53:46 +0000
committerPeter Eisentraut2022-11-03 16:04:22 +0000
commit2fe4c7384f469e077928cd40fa1da4bd05598f1f (patch)
tree7a1f024e13ae2307d20c9b9539bcde715844849c
parentdea83493800563d9f78b68bf9717988dd272c7c9 (diff)
Make AssertPointerAlignment available to frontend code
We don't need separate definitions for frontend and backend, since the contained Assert() will take care of the difference. So this also makes it simpler overall. Reviewed-by: Tom Lane <[email protected]> Reviewed-by: Michael Paquier <[email protected]> Discussion: https://www.postgresql.org/message-id/[email protected]
-rw-r--r--src/include/c.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/include/c.h b/src/include/c.h
index d70ed84ac5..98cdd285dd 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -793,14 +793,12 @@ typedef NameData *Name;
#define Assert(condition) ((void)true)
#define AssertMacro(condition) ((void)true)
-#define AssertPointerAlignment(ptr, bndr) ((void)true)
#elif defined(FRONTEND)
#include <assert.h>
#define Assert(p) assert(p)
#define AssertMacro(p) ((void) assert(p))
-#define AssertPointerAlignment(ptr, bndr) ((void)true)
#else /* USE_ASSERT_CHECKING && !FRONTEND */
@@ -824,14 +822,14 @@ typedef NameData *Name;
((void) ((condition) || \
(ExceptionalCondition(#condition, __FILE__, __LINE__), 0)))
+#endif /* USE_ASSERT_CHECKING && !FRONTEND */
+
/*
* Check that `ptr' is `bndr' aligned.
*/
#define AssertPointerAlignment(ptr, bndr) \
Assert(TYPEALIGN(bndr, (uintptr_t)(ptr)) == (uintptr_t)(ptr))
-#endif /* USE_ASSERT_CHECKING && !FRONTEND */
-
/*
* ExceptionalCondition is compiled into the backend whether or not
* USE_ASSERT_CHECKING is defined, so as to support use of extensions