diff --git a/Libraries/LibRegex/CMakeLists.txt b/Libraries/LibRegex/CMakeLists.txt index 7c4d8cd6872..05b0bb4ab3c 100644 --- a/Libraries/LibRegex/CMakeLists.txt +++ b/Libraries/LibRegex/CMakeLists.txt @@ -10,5 +10,5 @@ if(SERENITYOS) list(APPEND SOURCES C/Regex.cpp) endif() -serenity_lib(LibRegex regex) +serenity_lib(LibRegex regex EXPLICIT_SYMBOL_EXPORT) target_link_libraries(LibRegex PRIVATE LibUnicode) diff --git a/Libraries/LibRegex/Forward.h b/Libraries/LibRegex/Forward.h index 25cf3ba25b2..a7fb3e6005a 100644 --- a/Libraries/LibRegex/Forward.h +++ b/Libraries/LibRegex/Forward.h @@ -7,6 +7,7 @@ #pragma once #include +#include namespace regex { struct CompareTypeAndValuePair; diff --git a/Libraries/LibRegex/RegexByteCode.h b/Libraries/LibRegex/RegexByteCode.h index 6a10de9bdca..6e3d6fdd9b9 100644 --- a/Libraries/LibRegex/RegexByteCode.h +++ b/Libraries/LibRegex/RegexByteCode.h @@ -142,7 +142,7 @@ struct CompareTypeAndValuePair { class OpCode; -struct StringTable { +struct REGEX_API StringTable { StringTable(); ~StringTable(); StringTable(StringTable const&) = default; @@ -176,7 +176,7 @@ struct StringTable { HashMap m_inverse_table; }; -class ByteCode : public DisjointChunks { +class REGEX_API ByteCode : public DisjointChunks { using Base = DisjointChunks; public: diff --git a/Libraries/LibRegex/RegexLexer.h b/Libraries/LibRegex/RegexLexer.h index 01c086b2c3d..bf35d46c8a9 100644 --- a/Libraries/LibRegex/RegexLexer.h +++ b/Libraries/LibRegex/RegexLexer.h @@ -9,6 +9,7 @@ #include #include #include +#include namespace regex { @@ -64,7 +65,7 @@ private: StringView m_value {}; }; -class Lexer : public GenericLexer { +class REGEX_API Lexer : public GenericLexer { public: Lexer(); explicit Lexer(StringView source); diff --git a/Libraries/LibRegex/RegexMatcher.h b/Libraries/LibRegex/RegexMatcher.h index b0cffda1833..6018cf556ee 100644 --- a/Libraries/LibRegex/RegexMatcher.h +++ b/Libraries/LibRegex/RegexMatcher.h @@ -32,7 +32,7 @@ struct Block { static constexpr size_t const c_max_recursion = 5000; -struct RegexResult final { +struct REGEX_API RegexResult final { bool success { false }; size_t count { 0 }; Vector matches; @@ -44,10 +44,10 @@ struct RegexResult final { }; template -class Regex; +class REGEX_API Regex; template -class Matcher final { +class REGEX_API Matcher final { public: Matcher(Regex const* pattern, Optional::OptionsType> regex_options = {}) @@ -78,7 +78,7 @@ private: }; template -class Regex final { +class REGEX_API Regex final { public: ByteString pattern_value; regex::Parser::Result parser_result; diff --git a/Libraries/LibRegex/RegexParser.h b/Libraries/LibRegex/RegexParser.h index 5e5ae28bcb7..c13f9e84c8a 100644 --- a/Libraries/LibRegex/RegexParser.h +++ b/Libraries/LibRegex/RegexParser.h @@ -50,7 +50,7 @@ struct NamedCaptureGroup { size_t alternative_id; }; -class Parser { +class REGEX_API Parser { public: struct Result { ByteCode bytecode; @@ -137,7 +137,7 @@ protected: ParserState m_parser_state; }; -class AbstractPosixParser : public Parser { +class REGEX_API AbstractPosixParser : public Parser { protected: explicit AbstractPosixParser(Lexer& lexer) : Parser(lexer) @@ -152,7 +152,7 @@ protected: ALWAYS_INLINE bool parse_bracket_expression(Vector&, size_t&); }; -class PosixBasicParser final : public AbstractPosixParser { +class REGEX_API PosixBasicParser final : public AbstractPosixParser { public: explicit PosixBasicParser(Lexer& lexer) : AbstractPosixParser(lexer) @@ -181,7 +181,7 @@ private: size_t m_current_capture_group_depth { 0 }; }; -class PosixExtendedParser final : public AbstractPosixParser { +class REGEX_API PosixExtendedParser final : public AbstractPosixParser { constexpr static auto default_options = static_cast(AllFlags::SingleLine) | static_cast(AllFlags::Internal_ConsiderNewline); public: @@ -208,7 +208,7 @@ private: ALWAYS_INLINE bool parse_repetition_symbol(ByteCode&, size_t&); }; -class ECMA262Parser final : public Parser { +class REGEX_API ECMA262Parser final : public Parser { constexpr static ECMAScriptOptions default_options = static_cast(AllFlags::Internal_ConsiderNewline); public: