diff --git a/docraft/include/docraft/craft/docraft_craft_language_parser.h b/docraft/include/docraft/craft/docraft_craft_language_parser.h index cbdfb2b..08b0771 100644 --- a/docraft/include/docraft/craft/docraft_craft_language_parser.h +++ b/docraft/include/docraft/craft/docraft_craft_language_parser.h @@ -49,6 +49,9 @@ namespace docraft::craft { ~DocraftCraftLanguageParser() = default; + DocraftCraftLanguageParser(const DocraftCraftLanguageParser&) = delete; + DocraftCraftLanguageParser& operator=(const DocraftCraftLanguageParser&) = delete; + /** * @brief Parses craft language source (a single root element) as a string. * @param craft_language_source XML source as string. diff --git a/docraft/include/docraft/loom/craft/docraft_loom_tag_handler_registry.h b/docraft/include/docraft/loom/craft/docraft_loom_tag_handler_registry.h index 186db06..d4f9eaf 100644 --- a/docraft/include/docraft/loom/craft/docraft_loom_tag_handler_registry.h +++ b/docraft/include/docraft/loom/craft/docraft_loom_tag_handler_registry.h @@ -37,6 +37,9 @@ namespace docraft::loom::craft { public: static DocraftLoomTagHandlerRegistry& instance(); + DocraftLoomTagHandlerRegistry(const DocraftLoomTagHandlerRegistry&) = delete; + DocraftLoomTagHandlerRegistry& operator=(const DocraftLoomTagHandlerRegistry&) = delete; + void register_handler(const std::string& tag, std::unique_ptr handler); /** diff --git a/docraft/include/docraft/loom/docraft_loom_pdf_creator.h b/docraft/include/docraft/loom/docraft_loom_pdf_creator.h index 50ca666..dbd6fff 100644 --- a/docraft/include/docraft/loom/docraft_loom_pdf_creator.h +++ b/docraft/include/docraft/loom/docraft_loom_pdf_creator.h @@ -24,7 +24,7 @@ namespace docraft::loom { * and re-visited by the rendering pass for each physical page. The body is laid out * as one continuous flow and then split across pages by DocraftLoomPaginationProcessor. */ - class DocraftLoomPdfCreator + class DOCRAFT_LIB DocraftLoomPdfCreator { public: /** diff --git a/docraft/include/docraft/tools/docraft_validator.h b/docraft/include/docraft/tools/docraft_validator.h index a938ab9..5621aec 100644 --- a/docraft/include/docraft/tools/docraft_validator.h +++ b/docraft/include/docraft/tools/docraft_validator.h @@ -45,7 +45,7 @@ namespace docraft::tools { * @brief Aggregated result of DocraftValidator::validate(): every diagnostic found, * in the order they were discovered. */ - struct DocraftValidationResult + struct DOCRAFT_LIB DocraftValidationResult { std::vector issues; diff --git a/docraft/src/docraft/backend/pdf/docraft_haru_line_backend.cc b/docraft/src/docraft/backend/pdf/docraft_haru_line_backend.cc index ddc528d..238b59c 100644 --- a/docraft/src/docraft/backend/pdf/docraft_haru_line_backend.cc +++ b/docraft/src/docraft/backend/pdf/docraft_haru_line_backend.cc @@ -33,6 +33,15 @@ namespace docraft::backend::pdf { template ElemT dash_pattern_element_type(HPDF_STATUS (*)(PageT, const ElemT*, NumT, PhaseT)); +#if defined(_MSC_VER) && defined(_M_IX86) + // On 32-bit MSVC, HPDF_EXPORT declares libharu's API __stdcall, a distinct + // function pointer type from the implicit __cdecl overload above (they only + // coincide on x64) -- without this overload, deducing against + // &HPDF_Page_SetDash fails to compile on x86. + template + ElemT dash_pattern_element_type(HPDF_STATUS(__stdcall*)(PageT, const ElemT*, NumT, PhaseT)); +#endif + using DashPatternElement = decltype(dash_pattern_element_type(&HPDF_Page_SetDash)); void invoke_set_dash(HPDF_Page page, const std::vector& pattern) { diff --git a/docraft/src/docraft/loom/nodes/docraft_loom_node.cc b/docraft/src/docraft/loom/nodes/docraft_loom_node.cc index 0343899..a4b4088 100644 --- a/docraft/src/docraft/loom/nodes/docraft_loom_node.cc +++ b/docraft/src/docraft/loom/nodes/docraft_loom_node.cc @@ -87,7 +87,7 @@ namespace docraft::loom::nodes { std::vector DocraftLoomNode::paint_order_indices() const { std::vector indices(children_.size()); - std::ranges::iota(indices, 0); + std::iota(indices.begin(), indices.end(), 0); std::ranges::stable_sort(indices, [this](int a, int b) { return children_[static_cast(a)]->z_index() < children_[static_cast(b)]->z_index();