From a13a31738c7710d541ce89c51c8137fb8a5f91bc Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 17:49:33 +0000 Subject: [PATCH] The two symbols this file needs come from public headers now mruby made mrb_str_byte_subseq() public in d7bf6bcb: it left internal.h, which is for the callers inside the mruby tree, and it is in mruby/string.h with MRB_API. This file already included that header. MRB_PRESYM_MAX is the second one, and it moved the other way on the same day. f9fc1ff numbers presyms by layer, and it took the count out of presym/id.h - which mruby/presym.h includes, so every gem could read it - into presym/table.h. Tag 39 names a symbol by its presym number when it has one, so this file needs the count, and it now asks the table header for it. That include carries the guard mruby/presym.h and src/symbol.c both use. The build preprocesses every source to find the symbol literals in it, and writes these headers from what it finds, so during that pass the header does not exist yet. Without the guard the build cannot bootstrap: the header is a prerequisite of the pass that writes it. internal.h is gone from this gem. Tests: rake test against mruby master 662ba51, on a clean tree. 3225 total, 3201 OK, 0 KO, 0 crashes, 24 skipped. --- src/mrb_cbor.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/mrb_cbor.c b/src/mrb_cbor.c index d3397f5c..9d589a40 100644 --- a/src/mrb_cbor.c +++ b/src/mrb_cbor.c @@ -3,13 +3,20 @@ #include #include #include -MRB_BEGIN_DECL -#include - -MRB_END_DECL #include #include #include +/* MRB_PRESYM_MAX: mruby moved it out of presym/id.h, which + * mruby/presym.h includes, into the table header. Tag 39 names a symbol + * by its presym number, so this file needs the count. + * + * The guard is the one mruby/presym.h and src/symbol.c both use. The + * build preprocesses every source to find the symbol literals in it, and + * it writes these headers from what it finds - so during that pass the + * header this asks for does not exist yet. */ +#ifndef MRB_PRESYM_SCANNING +#include +#endif #include #include #include