5 Commits
Author SHA1 Message Date
Hiroshi SHIBATAandClaude Opus 5.5 4e746b14fd Make rb_len_t 64 bits on mswin
long is 32 bits on mswin while pointers are 64 bits, so String, Array and MatchData could not reach 2GiB there. config.h now sets SIZEOF_RB_LEN_T to 8 on mswin64, and value.h then defines rb_len_t as int64_t. mingw still uses long.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 16:07:39 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 c4d16f7aee Accept SIZEOF_RB_LEN_T defined by the build
mkmf's check_sizeof('rb_len_t') defines SIZEOF_RB_LEN_T as a number, which redefined the macro with different tokens and warned, failing builds that treat warnings as errors. A static assert checks a given value against the type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:00:15 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 5039d25b5a Add SIZEOF_RB_LEN_T
A typedef is invisible to the preprocessor, so an extension that also builds on older Ruby has no way to see whether `rb_len_t` exists or how wide it is. This gives it a macro to test before falling back to `typedef long rb_len_t`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:00:15 +09:00
Hiroshi SHIBATAandClaude Opus 5 03e3376643 Add rb_len_t for lengths and indices of objects
`long` is 32-bit on LLP64 platforms such as Windows, while VALUE and pointers are 64-bit. Giving the lengths and indices of objects such as String and Array a type of their own is what lets a later change widen them there. The typedef is `long` on every platform for now and a static assert pins it that way, because the conversion macros, PRI_LEN_PREFIX and the width guards around them are all still spelled in terms of `long`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-09 14:00:15 +09:00
yui-knk b481b673d7 [Feature #19719] Universal Parser
Introduce Universal Parser mode for the parser.
This commit includes these changes:

* Introduce `UNIVERSAL_PARSER` macro. All of CRuby related functions
  are passed via `struct rb_parser_config_struct` when this macro is enabled.
* Add CI task with 'cppflags=-DUNIVERSAL_PARSER' for ubuntu.
2023-06-12 18:23:48 +09:00