freebsd-ports/devel/simdjson/files/patch-include_simdjson_dom_serialization.h
Dimitry Andric 8c86705f8b devel/simdjson: fix build with clang 19
With clang 19, if a port uses simdjson.h, it leads to compile errors:

    In file included from /wrkdirs/usr/ports/sysutils/intel-pcm/work/pcm-202405/src/pcm-raw.cpp:31:
    /usr/local/include/simdjson.h:6156:13: error: no member named 'print_newline' in 'base_formatter<formatter>'
     6156 |       this->print_newline();
          |       ~~~~  ^
    /usr/local/include/simdjson.h:6160:13: error: no member named 'print_indents' in 'base_formatter<formatter>'
     6160 |       this->print_indents(depth);
          |       ~~~~  ^
    /usr/local/include/simdjson.h:6164:13: error: no member named 'print_space' in 'base_formatter<formatter>'
     6164 |       this->print_space();
          |       ~~~~  ^

Upstream <https://github.com/simdjson/simdjson/commit/5d35e7ca> fixes
this, but it does not directly add the change to the generated single
header version of simdjson.h. So apply the fix to both the individual
header and the amalgamated version.

PR:		280590
Approved by:	olevole@olevole.ru (maintainer)
MFH:		2024Q3
2024-08-16 17:33:49 +02:00

21 lines
652 B
C++

--- include/simdjson/dom/serialization.h.orig 2023-12-01 18:56:12 UTC
+++ include/simdjson/dom/serialization.h
@@ -57,15 +57,15 @@ class base_formatter { (public)
simdjson_inline void one_char(char c);
simdjson_inline void call_print_newline() {
- this->print_newline();
+ static_cast<formatter*>(this)->print_newline();
}
simdjson_inline void call_print_indents(size_t depth) {
- this->print_indents(depth);
+ static_cast<formatter*>(this)->print_indents(depth);
}
simdjson_inline void call_print_space() {
- this->print_space();
+ static_cast<formatter*>(this)->print_space();
}
protected: