summaryrefslogtreecommitdiff
path: root/contrib/hstore
diff options
context:
space:
mode:
authorPeter Eisentraut2025-12-12 07:58:34 +0000
committerPeter Eisentraut2025-12-12 09:06:40 +0000
commit493eb0da31be4520252e1af723342dc7ead0c3e5 (patch)
treeafb3274176a5b028929b3a47b51afd5228b2c0d2 /contrib/hstore
parent87a350e1f284bb99591f9185c0be0ae28899f38a (diff)
Replace most StaticAssertStmt() with StaticAssertDecl()
Similar to commit 75f49221c22, it is preferable to use StaticAssertDecl() instead of StaticAssertStmt() when possible. Discussion: https://www.postgresql.org/message-id/flat/CA%2BhUKGKvr0x_oGmQTUkx%3DODgSksT2EtgCA6LmGx_jQFG%3DsDUpg%40mail.gmail.com
Diffstat (limited to 'contrib/hstore')
-rw-r--r--contrib/hstore/hstore_compat.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/hstore/hstore_compat.c b/contrib/hstore/hstore_compat.c
index d75e9cb23f5..3a9f7f45cb7 100644
--- a/contrib/hstore/hstore_compat.c
+++ b/contrib/hstore/hstore_compat.c
@@ -94,7 +94,7 @@
* etc. are compatible.
*
* If the above statement isn't true on some bizarre platform, we're
- * a bit hosed (see StaticAssertStmt in hstoreValidOldFormat).
+ * a bit hosed.
*/
typedef struct
{
@@ -105,6 +105,9 @@ typedef struct
pos:31;
} HOldEntry;
+StaticAssertDecl(sizeof(HOldEntry) == 2 * sizeof(HEntry),
+ "old hstore format is not upward-compatible");
+
static int hstoreValidNewFormat(HStore *hs);
static int hstoreValidOldFormat(HStore *hs);
@@ -179,10 +182,6 @@ hstoreValidOldFormat(HStore *hs)
if (hs->size_ & HS_FLAG_NEWVERSION)
return 0;
- /* New format uses an HEntry for key and another for value */
- StaticAssertStmt(sizeof(HOldEntry) == 2 * sizeof(HEntry),
- "old hstore format is not upward-compatible");
-
if (count == 0)
return 2;