[SCM] PostGIS branch master updated. 3.7.0beta1-134-gd9fd33a277
git at osgeo.org
git at osgeo.org
Thu Jul 30 02:45:45 PDT 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via d9fd33a2778f2a23ea7ef4b330f6c393bcba9c2f (commit)
via 3c311ca6c859541e07972b46ab09b44ea7e619fe (commit)
from 7733d37ea04f187c318cff0e6e2f95e1dab7a92a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d9fd33a2778f2a23ea7ef4b330f6c393bcba9c2f
Merge: 7733d37ea0 3c311ca6c8
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date: Thu Jul 30 02:45:39 2026 -0700
Merge pull request 'Update vendored dependency records' (!627) from Komzpa/postgis:docs/vendored-dependency-versions-20260730 into master
Update the vendored dependency record and the one low-risk vendored header that was actually behind.
Changes:
- update `deps/uthash/include/uthash.h` from upstream `troydhanson/uthash` `v2.4.0`, retaining the PostGIS `HASH_FUNCTION` collision fix as `UTHASH_FUNCTION`
- add a `deps/flatgeobuf/README.md` so the vendored FlatGeobuf snapshot has a source/provenance home
- record the current vendored dependency refresh policy and current upstream release state in `doc/development/release/dependencies.md`
- update the Wagyu, Ryu, and uthash README provenance notes
- pull in upstream Ryu's unreleased `pow5Factor()` optimization from https://github.com/ulfjack/ryu/pull/188 without replacing the PostGIS-specific formatter APIs
- add a focused CUnit check for the vendored Ryu `pow5Factor()` path
- record the upstream FlatGeobuf PR for the portable C++ packed R-tree big-endian fix: https://github.com/flatgeobuf/flatgeobuf/pull/512
Notes:
- Wagyu remains at upstream release `0.5.0`, which is still the latest tag found upstream.
- Ryu remains a PostGIS-modified `v2.0`-derived snapshot. The initial extraction included small UBSan fixes, but the current vendored copy exposes PostGIS-specific `d2sfixed_buffered_n` / `d2sexp_buffered_n` APIs and output semantics; upstream `v2.0` is still the latest release tag found upstream. Upstream `master` has unreleased changes, mostly outside the current PostGIS path; the branch now carries the isolated `pow5Factor()` optimization and documents the inactive `RYU_OPTIMIZE_SIZE` small-table header gap.
- FlatGeobuf currently has no embedded upstream package version; the docs now say to record an exact upstream tag or commit before any future refresh.
Validation:
- `git ls-remote upstream refs/heads/master` -> `7733d37ea04f187c318cff0e6e2f95e1dab7a92a`
- `git diff --check`
- `git clang-format --diff upstream/master -- liblwgeom/cunit/cu_print.c deps/ryu/d2s_intrinsics.h`
- `./autogen.sh && ./configure --without-raster`
- `make postgis_revision.h && make -C deps -j8 && make -C liblwgeom -j8 && make -C postgis -j8`
- after the Ryu optimization: `make -C deps/ryu clean && make -C deps/ryu -j8 && make -C liblwgeom clean && make -C liblwgeom -j8 && make -C liblwgeom/cunit clean && make -C liblwgeom/cunit -j8 && ./liblwgeom/cunit/cu_tester printing`
- default Ryu compile probe: `cc -std=gnu11 -Ideps -c deps/ryu/d2s.c -o /tmp/postgis-ryu-default-after-pow5.o`
Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/627
commit 3c311ca6c859541e07972b46ab09b44ea7e619fe
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Thu Jul 30 04:12:06 2026 +0400
Update vendored dependency records
diff --git a/deps/flatgeobuf/README.md b/deps/flatgeobuf/README.md
new file mode 100644
index 0000000000..d143f8d301
--- /dev/null
+++ b/deps/flatgeobuf/README.md
@@ -0,0 +1,30 @@
+# FlatGeobuf
+
+This directory contains the FlatGeobuf C++ support code and a vendored
+FlatBuffers header snapshot used by PostGIS FlatGeobuf input/output.
+
+The upstream project is <https://github.com/flatgeobuf/flatgeobuf>. The
+vendored FlatGeobuf files do not carry an embedded upstream package version, so
+refreshes must record the exact upstream commit or release tag used.
+
+The FlatBuffers headers under `include/flatbuffers/` currently report version
+23.3.3 in `include/flatbuffers/base.h`. Keep those headers in the
+`FlatGeobuf` namespace used by this vendored copy when refreshing from
+upstream.
+
+# Local changes from source
+
+ - Use the PostGIS allocator and C bridge in `flatgeobuf_c.*`.
+ - Keep the vendored FlatBuffers copy in a unique namespace.
+ - Preserve the PostGIS byte-order fixes for big-endian platforms.
+ - The portable C++ `packedrtree.cpp` part of the big-endian fix was submitted
+ upstream as https://github.com/flatgeobuf/flatgeobuf/pull/512. If it lands,
+ drop that duplicated local delta during the next FlatGeobuf refresh; the
+ `geometryreader.cpp` part remains PostGIS-specific glue.
+
+# Changelog
+
+ - 2021-09-20 - Add FlatGeobuf format input/output support.
+ - 2022-05-08 - Upgrade FlatBuffers and generated FlatGeobuf headers.
+ - 2023-05-05 - Upgrade FlatGeobuf dependencies.
+ - 2026-07-27 - Handle FlatGeobuf byte order on big-endian platforms.
diff --git a/deps/ryu/README.md b/deps/ryu/README.md
index 25a0bb959c..f1bdfbbbb6 100644
--- a/deps/ryu/README.md
+++ b/deps/ryu/README.md
@@ -18,7 +18,7 @@ Ryu Printf implements %f and %e formatting in a way that should be drop-in compa
## Implementation
-The C implementation of Ryu comes from the ryu/ directory in the git repostitory (https://github.com/ulfjack/ryu).
+The C implementation of Ryu comes from the ryu/ directory in the git repository (https://github.com/ulfjack/ryu).
We've only copied the necessary files, that is `d2s.c` and its headers. It is integrated in the project by generating a static library, libryu.la.
@@ -37,7 +37,24 @@ The output has also been changed to match the old behaviour:
- Uses "e-1" instead of E-1.
- Never outputs negative 0. It always returns "0".
+This is not only a compiler-warning delta. The first PostGIS extraction did
+include small UBSan fixes, but the current vendored snapshot exposes
+PostGIS-specific `d2sfixed_buffered_n` and `d2sexp_buffered_n` APIs and
+PostGIS output semantics. The earlier trailing-zero behavior was discussed
+upstream in https://github.com/ulfjack/ryu/issues/142 and was not accepted as a
+drop-in upstream change.
+
+Upstream `master` has unreleased changes after `v2.0`, mostly for parsing,
+float conversion, build/test integration, and table-size options. This copy
+includes the `pow5Factor()` optimization from
+https://github.com/ulfjack/ryu/pull/188, which applies cleanly to the PostGIS
+printing path. Also note that this vendored copy still has an inactive
+`RYU_OPTIMIZE_SIZE` include path for `d2s_small_table.h`, but does not vendor
+that header; PostGIS does not define `RYU_OPTIMIZE_SIZE`, so the default build
+is unaffected.
+
### Dependency changelog
- 2019-01-10 - [Ryu] Library extraction from https://github.com/ulfjack/ryu/tree/master/ryu. Added changes to remove trailing zeros from the output and minor changes to please ubsan.
- 2020-07-20 - [Ryu] Switch from d2fixed/d2exp to d2sfixed/d2sexp, that is, using the shortest notation
+ - 2026-07-30 - Confirmed v2.0 is still the latest upstream Ryu release tag; this copy keeps PostGIS-specific precision and formatting changes, plus the unreleased upstream pow5Factor optimization from https://github.com/ulfjack/ryu/pull/188.
diff --git a/deps/ryu/d2s_intrinsics.h b/deps/ryu/d2s_intrinsics.h
index f68a7fac5f..c7ebd5f0b3 100644
--- a/deps/ryu/d2s_intrinsics.h
+++ b/deps/ryu/d2s_intrinsics.h
@@ -192,15 +192,15 @@ static inline uint32_t mod1e9(const uint64_t x) {
#endif // defined(RYU_32_BIT_PLATFORM)
static inline uint32_t pow5Factor(uint64_t value) {
+ const uint64_t m_inv_5 = 14757395258967641293u; // 5 * m_inv_5 = 1 (mod 2^64)
+ const uint64_t n_div_5 = 3689348814741910323u; // 2^64 / 5
uint32_t count = 0;
for (;;) {
assert(value != 0);
- const uint64_t q = div5(value);
- const uint32_t r = ((uint32_t) value) - 5 * ((uint32_t) q);
- if (r != 0) {
+ value *= m_inv_5;
+ if (value > n_div_5) {
break;
}
- value = q;
++count;
}
return count;
diff --git a/deps/uthash/README.md b/deps/uthash/README.md
index 3aa65a4a8f..425dc17871 100644
--- a/deps/uthash/README.md
+++ b/deps/uthash/README.md
@@ -2,7 +2,7 @@
Uthash is a single header library to manage hash tables.
-The full documentation can be found at its [User Guide](http://troydhanson.github.io/uthash/userguide.html) and the original code at [Github](https://github.com/troydhanson/uthash/).
+The full documentation can be found at its [User Guide](https://troydhanson.github.io/uthash/userguide.html) and the original code at [GitHub](https://github.com/troydhanson/uthash/).
# Changes from source
@@ -11,3 +11,4 @@ The full documentation can be found at its [User Guide](http://troydhanson.githu
# Changelog
- 2019-03-22 - Code was moved from postgis/ and updated to 2.1.0.
+ - 2026-07-30 - Update `uthash.h` to 2.4.0 from https://github.com/troydhanson/uthash/tree/v2.4.0/src.
diff --git a/deps/uthash/include/uthash.h b/deps/uthash/include/uthash.h
index 7ce3f19824..7bfa158768 100644
--- a/deps/uthash/include/uthash.h
+++ b/deps/uthash/include/uthash.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2003-2018, Troy D. Hanson http://troydhanson.github.com/uthash/
+Copyright (c) 2003-2026, Troy D. Hanson https://troydhanson.github.io/uthash/
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -24,12 +24,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef UTHASH_H
#define UTHASH_H
-#define UTHASH_VERSION 2.1.0
+#define UTHASH_VERSION 2.4.0
#include <string.h> /* memcmp, memset, strlen */
#include <stddef.h> /* ptrdiff_t */
#include <stdlib.h> /* exit */
+#if defined(HASH_NO_STDINT) && HASH_NO_STDINT
+/* The user doesn't have <stdint.h>, and must figure out their own way
+ to provide definitions for uint8_t and uint32_t. */
+#else
+#include <stdint.h> /* uint8_t, uint32_t */
+#endif
+
/* These macros use decltype or the earlier __typeof GNU extension.
As decltype is only available in newer compilers (VS2010 or gcc 4.3+
when compiling c++ source) this code uses whatever method is needed
@@ -41,6 +48,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#else /* VS2008 or older (or VS2010 in C mode) */
#define NO_DECLTYPE
#endif
+#elif defined(__MCST__) /* Elbrus C Compiler */
+#define DECLTYPE(x) (__typeof(x))
#elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__)
#define NO_DECLTYPE
#else /* GNU, Sun and other compilers */
@@ -62,23 +71,6 @@ do {
} while (0)
#endif
-/* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */
-#if defined(_WIN32)
-#if defined(_MSC_VER) && _MSC_VER >= 1600
-#include <stdint.h>
-#elif defined(__WATCOMC__) || defined(__MINGW32__) || defined(__CYGWIN__)
-#include <stdint.h>
-#else
-typedef unsigned int uint32_t;
-typedef unsigned char uint8_t;
-#endif
-#elif defined(__GNUC__) && !defined(__VXWORKS__)
-#include <stdint.h>
-#else
-typedef unsigned int uint32_t;
-typedef unsigned char uint8_t;
-#endif
-
#ifndef uthash_malloc
#define uthash_malloc(sz) malloc(sz) /* malloc fcn */
#endif
@@ -92,15 +84,12 @@ typedef unsigned char uint8_t;
#define uthash_strlen(s) strlen(s)
#endif
-#ifdef uthash_memcmp
-/* This warning will not catch programs that define uthash_memcmp AFTER including uthash.h. */
-#warning "uthash_memcmp is deprecated; please use HASH_KEYCMP instead"
-#else
-#define uthash_memcmp(a,b,n) memcmp(a,b,n)
+#ifndef UTHASH_FUNCTION
+#define UTHASH_FUNCTION(keyptr,keylen,hashv) HASH_JEN(keyptr, keylen, hashv)
#endif
#ifndef HASH_KEYCMP
-#define HASH_KEYCMP(a,b,n) uthash_memcmp(a,b,n)
+#define HASH_KEYCMP(a,b,n) memcmp(a,b,n)
#endif
#ifndef uthash_noexpand_fyi
@@ -114,22 +103,6 @@ typedef unsigned char uint8_t;
#define HASH_NONFATAL_OOM 0
#endif
-#ifndef FALLTHROUGH
- #if defined(__cplusplus) && __cplusplus >= 201703L
- #define FALLTHROUGH [[fallthrough]]
- #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
- #define FALLTHROUGH [[fallthrough]]
- #elif defined(__clang__)
- #define FALLTHROUGH __attribute__((fallthrough))
- #elif defined(__GNUC__) && __GNUC__ >= 7
- #define FALLTHROUGH __attribute__((fallthrough))
- #elif defined(_MSC_VER) && _MSC_VER >= 1910
- #define FALLTHROUGH [[fallthrough]]
- #else
- #define FALLTHROUGH ((void)0)
- #endif
-#endif
-
#if HASH_NONFATAL_OOM
/* malloc failures can be recovered from */
@@ -160,7 +133,7 @@ typedef unsigned char uint8_t;
/* calculate the element whose hash handle address is hhp */
#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho)))
/* calculate the hash handle from element address elp */
-#define HH_FROM_ELMT(tbl,elp) ((UT_hash_handle *)(((char*)(elp)) + ((tbl)->hho)))
+#define HH_FROM_ELMT(tbl,elp) ((UT_hash_handle*)(void*)(((char*)(elp)) + ((tbl)->hho)))
#define HASH_ROLLBACK_BKT(hh, head, itemptrhh) \
do { \
@@ -174,7 +147,7 @@ do {
#define HASH_VALUE(keyptr,keylen,hashv) \
do { \
- HASH_FCN(keyptr, keylen, hashv); \
+ UTHASH_FUNCTION(keyptr, keylen, hashv); \
} while (0)
#define HASH_FIND_BYHASHVALUE(hh,head,keyptr,keylen,hashval,out) \
@@ -183,7 +156,7 @@ do {
if (head) { \
unsigned _hf_bkt; \
HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _hf_bkt); \
- if (HASH_BLOOM_TEST((head)->hh.tbl, hashval) != 0) { \
+ if (HASH_BLOOM_TEST((head)->hh.tbl, hashval)) { \
HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], keyptr, keylen, hashval, out); \
} \
} \
@@ -191,9 +164,12 @@ do {
#define HASH_FIND(hh,head,keyptr,keylen,out) \
do { \
- unsigned _hf_hashv; \
- HASH_VALUE(keyptr, keylen, _hf_hashv); \
- HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, _hf_hashv, out); \
+ (out) = NULL; \
+ if (head) { \
+ unsigned _hf_hashv; \
+ HASH_VALUE(keyptr, keylen, _hf_hashv); \
+ HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, _hf_hashv, out); \
+ } \
} while (0)
#ifdef HASH_BLOOM
@@ -217,7 +193,7 @@ do {
} while (0)
#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8U] |= (1U << ((idx)%8U)))
-#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8U] & (1U << ((idx)%8U)))
+#define HASH_BLOOM_BITTEST(bv,idx) ((bv[(idx)/8U] & (1U << ((idx)%8U))) != 0)
#define HASH_BLOOM_ADD(tbl,hashv) \
HASH_BLOOM_BITSET((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U)))
@@ -229,7 +205,7 @@ do {
#define HASH_BLOOM_MAKE(tbl,oomed)
#define HASH_BLOOM_FREE(tbl)
#define HASH_BLOOM_ADD(tbl,hashv)
-#define HASH_BLOOM_TEST(tbl,hashv) (1)
+#define HASH_BLOOM_TEST(tbl,hashv) 1
#define HASH_BLOOM_BYTELEN 0U
#endif
@@ -421,7 +397,7 @@ do {
do { \
IF_HASH_NONFATAL_OOM( int _ha_oomed = 0; ) \
(add)->hh.hashv = (hashval); \
- (add)->hh.key = (char*) (keyptr); \
+ (add)->hh.key = (const void*) (keyptr); \
(add)->hh.keylen = (unsigned) (keylen_in); \
if (!(head)) { \
(add)->hh.next = NULL; \
@@ -473,7 +449,7 @@ do {
#define HASH_DELETE_HH(hh,head,delptrhh) \
do { \
- struct UT_hash_handle *_hd_hh_del = (delptrhh); \
+ const struct UT_hash_handle *_hd_hh_del = (delptrhh); \
if ((_hd_hh_del->prev == NULL) && (_hd_hh_del->next == NULL)) { \
HASH_BLOOM_FREE((head)->hh.tbl); \
uthash_free((head)->hh.tbl->buckets, \
@@ -535,7 +511,8 @@ do {
* This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.
*/
#ifdef HASH_DEBUG
-#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
+#include <stdio.h> /* fprintf, stderr */
+#define HASH_OOPS(...) do { fprintf(stderr, __VA_ARGS__); exit(-1); } while (0)
#define HASH_FSCK(hh,head,where) \
do { \
struct UT_hash_handle *_thh; \
@@ -602,13 +579,6 @@ do {
#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)
#endif
-/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */
-#ifdef UTHASH_FUNCTION
-#define HASH_FCN UTHASH_FUNCTION
-#else
-#define HASH_FCN HASH_JEN
-#endif
-
/* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */
#define HASH_BER(key,keylen,hashv) \
do { \
@@ -622,7 +592,9 @@ do {
/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at
- * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */
+ * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
+ * (archive link: https://archive.is/Ivcan )
+ */
#define HASH_SAX(key,keylen,hashv) \
do { \
unsigned _sx_i; \
@@ -697,17 +669,18 @@ do {
} \
hashv += (unsigned)(keylen); \
switch ( _hj_k ) { \
- case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); FALLTHROUGH; \
- case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); FALLTHROUGH; \
- case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); FALLTHROUGH; \
- case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); FALLTHROUGH; \
- case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); FALLTHROUGH; \
- case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); FALLTHROUGH; \
- case 5: _hj_j += _hj_key[4]; FALLTHROUGH; \
- case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); FALLTHROUGH; \
- case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); FALLTHROUGH; \
- case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); FALLTHROUGH; \
- case 1: _hj_i += _hj_key[0]; \
+ case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); /* FALLTHROUGH */ \
+ case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); /* FALLTHROUGH */ \
+ case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); /* FALLTHROUGH */ \
+ case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); /* FALLTHROUGH */ \
+ case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); /* FALLTHROUGH */ \
+ case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); /* FALLTHROUGH */ \
+ case 5: _hj_j += _hj_key[4]; /* FALLTHROUGH */ \
+ case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); /* FALLTHROUGH */ \
+ case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); /* FALLTHROUGH */ \
+ case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); /* FALLTHROUGH */ \
+ case 1: _hj_i += _hj_key[0]; /* FALLTHROUGH */ \
+ default: ; \
} \
HASH_JEN_MIX(_hj_i, _hj_j, hashv); \
} while (0)
@@ -755,6 +728,8 @@ do {
case 1: hashv += *_sfh_key; \
hashv ^= hashv << 10; \
hashv += hashv >> 1; \
+ break; \
+ default: ; \
} \
\
/* Force "avalanching" of final 127 bits */ \
@@ -766,87 +741,6 @@ do {
hashv += hashv >> 6; \
} while (0)
-#ifdef HASH_USING_NO_STRICT_ALIASING
-/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads.
- * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error.
- * MurmurHash uses the faster approach only on CPU's where we know it's safe.
- *
- * Note the preprocessor built-in defines can be emitted using:
- *
- * gcc -m64 -dM -E - < /dev/null (on gcc)
- * cc -## a.c (where a.c is a simple test file) (Sun Studio)
- */
-#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86))
-#define MUR_GETBLOCK(p,i) p[i]
-#else /* non intel */
-#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 3UL) == 0UL)
-#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 3UL) == 1UL)
-#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 3UL) == 2UL)
-#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 3UL) == 3UL)
-#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))
-#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))
-#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))
-#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))
-#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8))
-#else /* assume little endian non-intel */
-#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24))
-#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16))
-#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8))
-#endif
-#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \
- (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \
- (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \
- MUR_ONE_THREE(p))))
-#endif
-#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))
-#define MUR_FMIX(_h) \
-do { \
- _h ^= _h >> 16; \
- _h *= 0x85ebca6bu; \
- _h ^= _h >> 13; \
- _h *= 0xc2b2ae35u; \
- _h ^= _h >> 16; \
-} while (0)
-
-#define HASH_MUR(key,keylen,hashv) \
-do { \
- const uint8_t *_mur_data = (const uint8_t*)(key); \
- const int _mur_nblocks = (int)(keylen) / 4; \
- uint32_t _mur_h1 = 0xf88D5353u; \
- uint32_t _mur_c1 = 0xcc9e2d51u; \
- uint32_t _mur_c2 = 0x1b873593u; \
- uint32_t _mur_k1 = 0; \
- const uint8_t *_mur_tail; \
- const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+(_mur_nblocks*4)); \
- int _mur_i; \
- for (_mur_i = -_mur_nblocks; _mur_i != 0; _mur_i++) { \
- _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \
- _mur_k1 *= _mur_c1; \
- _mur_k1 = MUR_ROTL32(_mur_k1,15); \
- _mur_k1 *= _mur_c2; \
- \
- _mur_h1 ^= _mur_k1; \
- _mur_h1 = MUR_ROTL32(_mur_h1,13); \
- _mur_h1 = (_mur_h1*5U) + 0xe6546b64u; \
- } \
- _mur_tail = (const uint8_t*)(_mur_data + (_mur_nblocks*4)); \
- _mur_k1=0; \
- switch ((keylen) & 3U) { \
- case 0: break; \
- case 3: _mur_k1 ^= (uint32_t)_mur_tail[2] << 16; /* FALLTHROUGH */ \
- case 2: _mur_k1 ^= (uint32_t)_mur_tail[1] << 8; /* FALLTHROUGH */ \
- case 1: _mur_k1 ^= (uint32_t)_mur_tail[0]; \
- _mur_k1 *= _mur_c1; \
- _mur_k1 = MUR_ROTL32(_mur_k1,15); \
- _mur_k1 *= _mur_c2; \
- _mur_h1 ^= _mur_k1; \
- } \
- _mur_h1 ^= (uint32_t)(keylen); \
- MUR_FMIX(_mur_h1); \
- hashv = _mur_h1; \
-} while (0)
-#endif /* HASH_USING_NO_STRICT_ALIASING */
-
/* iterate over items in a known bucket to find desired item */
#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,hashval,out) \
do { \
@@ -857,7 +751,7 @@ do {
} \
while ((out) != NULL) { \
if ((out)->hh.hashv == (hashval) && (out)->hh.keylen == (keylen_in)) { \
- if (HASH_KEYCMP((out)->hh.key, keyptr, keylen_in) == 0) { \
+ if (HASH_KEYCMP((out)->hh.key, keyptr, keylen_in) == 0) { \
break; \
} \
} \
@@ -943,12 +837,12 @@ do {
struct UT_hash_handle *_he_thh, *_he_hh_nxt; \
UT_hash_bucket *_he_new_buckets, *_he_newbkt; \
_he_new_buckets = (UT_hash_bucket*)uthash_malloc( \
- 2UL * (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
+ sizeof(struct UT_hash_bucket) * (tbl)->num_buckets * 2U); \
if (!_he_new_buckets) { \
HASH_RECORD_OOM(oomed); \
} else { \
uthash_bzero(_he_new_buckets, \
- 2UL * (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
+ sizeof(struct UT_hash_bucket) * (tbl)->num_buckets * 2U); \
(tbl)->ideal_chain_maxlen = \
((tbl)->num_items >> ((tbl)->log2_num_buckets+1U)) + \
((((tbl)->num_items & (((tbl)->num_buckets*2U)-1U)) != 0U) ? 1U : 0U); \
@@ -1096,7 +990,7 @@ do {
_elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \
if (cond(_elt)) { \
IF_HASH_NONFATAL_OOM( int _hs_oomed = 0; ) \
- _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \
+ _dst_hh = (UT_hash_handle*)(void*)(((char*)_elt) + _dst_hho); \
_dst_hh->key = _src_hh->key; \
_dst_hh->keylen = _src_hh->keylen; \
_dst_hh->hashv = _src_hh->hashv; \
@@ -1235,7 +1129,7 @@ typedef struct UT_hash_handle {
void *next; /* next element in app order */
struct UT_hash_handle *hh_prev; /* previous hh in bucket order */
struct UT_hash_handle *hh_next; /* next hh in bucket order */
- void *key; /* ptr to enclosing struct's key */
+ const void *key; /* ptr to enclosing struct's key */
unsigned keylen; /* enclosing struct's key len */
unsigned hashv; /* result of hash-fcn(key) */
} UT_hash_handle;
diff --git a/deps/wagyu/README.md b/deps/wagyu/README.md
index dc6f25efad..691dd3fbb4 100644
--- a/deps/wagyu/README.md
+++ b/deps/wagyu/README.md
@@ -26,3 +26,4 @@ It is integrated in the project as an static library inside postgis.so, so it do
- 2019-02-05 - [Wagyu] Library extraction from https://github.com/mapbox/wagyu
- 2019-02-05 - [geometry.hpp] Library extraction from https://github.com/mapbox/geometry.hpp
- 2020-05-08 - [Wagyu] Update to 0.5.0
+ - 2026-07-30 - Confirmed 0.5.0 is still the latest upstream Wagyu release tag.
diff --git a/doc/development/release/dependencies.md b/doc/development/release/dependencies.md
index 9d6c91827a..dcfcbec60f 100644
--- a/doc/development/release/dependencies.md
+++ b/doc/development/release/dependencies.md
@@ -93,6 +93,20 @@ For GEOS, revision-level runtime and header information is tracked upstream in
PostGIS can decide how much of it belongs in `postgis_full_version()` and the
GEOS version helper functions.
+## Vendored Dependency Refreshes
+
+PostGIS vendors a small number of source dependencies under `deps/`. Treat
+these directories as maintained source snapshots, not as package-manager
+inputs. Before refreshing one, read its local README, compare the PostGIS-local
+bridge patches, and record the exact upstream release tag or commit used.
+
+| Dependency | Local version or snapshot | Upstream source | Refresh notes |
+|------------|---------------------------|-----------------|---------------|
+| Wagyu | 0.5.0 | <https://github.com/mapbox/wagyu> | Used only when protobuf-c support enables MVT. The vendored copy includes PostGIS bridge code in `deps/wagyu/lwgeom_wagyu.*`; upstream 0.5.0 is the latest release tag as of 2026-07-30. |
+| Ryu | v2.0-derived snapshot | <https://github.com/ulfjack/ryu> | `deps/ryu/README.md` documents substantial PostGIS precision and formatting changes. Do not overwrite it from upstream without preserving those changes and validating `lwprint_double` output. This copy includes the unreleased upstream `pow5Factor()` optimization from <https://github.com/ulfjack/ryu/pull/188>. Upstream v2.0 is the latest release tag as of 2026-07-30. |
+| FlatGeobuf | unversioned FlatGeobuf snapshot, FlatBuffers 23.3.3 headers | <https://github.com/flatgeobuf/flatgeobuf> | The FlatGeobuf files do not embed an upstream package version. Refresh by recording the exact upstream tag or commit, regenerating the FlatGeobuf headers, preserving the unique FlatBuffers namespace, and keeping PostGIS big-endian fixes. The portable `packedrtree.cpp` big-endian fix is proposed upstream in <https://github.com/flatgeobuf/flatgeobuf/pull/512>. Upstream 3.26.2 is the latest FlatGeobuf release tag as of 2026-07-30. |
+| uthash | 2.4.0 | <https://github.com/troydhanson/uthash> | `deps/uthash/include/uthash.h` comes from upstream `v2.4.0/src/uthash.h` with PostGIS' `HASH_FUNCTION` collision fix retained as `UTHASH_FUNCTION`. |
+
## Removing Support for PostgreSQL Versions
When dropping support for an older PostgreSQL major version:
diff --git a/liblwgeom/cunit/Makefile.in b/liblwgeom/cunit/Makefile.in
index 3999c55232..623dc401d9 100644
--- a/liblwgeom/cunit/Makefile.in
+++ b/liblwgeom/cunit/Makefile.in
@@ -20,7 +20,7 @@ SHELL = @SHELL@
LIBTOOL = @LIBTOOL@
CUNIT_LDFLAGS=@CUNIT_LDFLAGS@
-CUNIT_CPPFLAGS = -I$(srcdir)/.. -I$(builddir)/.. @CUNIT_CPPFLAGS@ @CPPFLAGS@
+CUNIT_CPPFLAGS = -I$(srcdir)/.. -I$(builddir)/.. -I$(srcdir)/../../deps/ryu/.. @CUNIT_CPPFLAGS@ @CPPFLAGS@
CFLAGS=$(CUNIT_CPPFLAGS) @CFLAGS@
LDFLAGS = @GEOS_LDFLAGS@ @PROJ_LDFLAGS@ $(CUNIT_LDFLAGS)
LIBLWGEOM_LDFLAGS = @GMP_LIBS@
diff --git a/liblwgeom/cunit/cu_print.c b/liblwgeom/cunit/cu_print.c
index e22c83f75e..6c65a89f8a 100644
--- a/liblwgeom/cunit/cu_print.c
+++ b/liblwgeom/cunit/cu_print.c
@@ -16,6 +16,7 @@
#include "liblwgeom_internal.h"
#include "cu_tester.h"
+#include "ryu/d2s_intrinsics.h"
static void
test_lwpoint_to_latlon_assert_format(char *point_wkt, const char *format, const char *expected)
@@ -566,6 +567,23 @@ test_lwprint_roundtrip(void)
*/
}
+static void
+test_ryu_pow5factor(void)
+{
+ CU_ASSERT_EQUAL(pow5Factor(1ull), 0);
+ CU_ASSERT_EQUAL(pow5Factor(2ull), 0);
+ CU_ASSERT_EQUAL(pow5Factor(5ull), 1);
+ CU_ASSERT_EQUAL(pow5Factor(10ull), 1);
+ CU_ASSERT_EQUAL(pow5Factor(25ull), 2);
+ CU_ASSERT_EQUAL(pow5Factor(125ull), 3);
+ CU_ASSERT_EQUAL(pow5Factor(3125ull), 5);
+ CU_ASSERT_EQUAL(pow5Factor(42ull), 0);
+ CU_ASSERT_EQUAL(pow5Factor(42 * 5 * 5 * 5ull), 3);
+ CU_ASSERT_EQUAL(pow5Factor(7450580596923828125ull), 27);
+ CU_ASSERT_EQUAL(pow5Factor(18446744073709551615ull), 1);
+ CU_ASSERT_EQUAL(pow5Factor(18446744073709551614ull), 0);
+}
+
/*
** Callback used by the test harness to register the tests in this file.
*/
@@ -580,5 +598,5 @@ void print_suite_setup(void)
PG_ADD_TEST(suite, test_lwpoint_to_latlon_bad_formats);
PG_ADD_TEST(suite, test_lwprint);
PG_ADD_TEST(suite, test_lwprint_roundtrip);
+ PG_ADD_TEST(suite, test_ryu_pow5factor);
}
-
-----------------------------------------------------------------------
Summary of changes:
deps/flatgeobuf/README.md | 30 +++++
deps/ryu/README.md | 19 ++-
deps/ryu/d2s_intrinsics.h | 8 +-
deps/uthash/README.md | 3 +-
deps/uthash/include/uthash.h | 208 ++++++++------------------------
deps/wagyu/README.md | 1 +
doc/development/release/dependencies.md | 14 +++
liblwgeom/cunit/Makefile.in | 2 +-
liblwgeom/cunit/cu_print.c | 20 ++-
9 files changed, 140 insertions(+), 165 deletions(-)
create mode 100644 deps/flatgeobuf/README.md
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list