LibRegex: Export OpCode/OpCode_Compare for REGEX_DEBUG builds

When building with REGEX_DEBUG or ENABLE_ALL_THE_DEBUG_MACROS there are
two issues with linking of bin/TestRegex

 - Libraries/LibRegex/RegexDebug.h:76 with undefined reference
       regex::OpCode_Compare::variable_arguments_to_byte_string(
           AK::Optional<regex::MatchInput const&>) const

 - Libraries/LibRegex/RegexByteCode.h:672 with undefined reference
       regex::OpCode::name(regex::OpCodeId)

Add REGEX_API on regex::OpCode and regex::OptCode_Compare to allow
access to the classes in bin/TestRegex
This commit is contained in:
Rocco Corsi 2025-09-17 14:43:20 -04:00 committed by Ali Mohammad Pur
parent 73658c9785
commit 3d1d055e27

View File

@ -640,7 +640,7 @@ StringView boundary_check_type_name(BoundaryCheckType);
StringView character_compare_type_name(CharacterCompareType result);
StringView character_class_name(CharClass ch_class);
class OpCode {
class REGEX_API OpCode {
public:
OpCode() = default;
virtual ~OpCode() = default;
@ -846,7 +846,7 @@ public:
}
};
class OpCode_Compare final : public OpCode {
class REGEX_API OpCode_Compare final : public OpCode {
public:
ExecutionResult execute(MatchInput const& input, MatchState& state) const override;
ALWAYS_INLINE OpCodeId opcode_id() const override { return OpCodeId::Compare; }