From edd5884a1a788a3a848ca1569a26db723381532d Mon Sep 17 00:00:00 2001 From: klayoutmatthias Date: Wed, 15 Dec 2021 00:31:13 +0100 Subject: [PATCH] WIP: enabling build on MSVC2019 with Qt6 --- src/db/db/dbBox.h | 12 ++++++++++++ src/db/db/dbBoxScanner.h | 8 ++++++-- src/db/db/dbHierProcessor.cc | 11 +++++++++++ src/db/db/dbHierProcessor.h | 2 +- src/klayout.pri | 9 +++++++-- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/db/db/dbBox.h b/src/db/db/dbBox.h index 08177b319..5be7f744b 100644 --- a/src/db/db/dbBox.h +++ b/src/db/db/dbBox.h @@ -1119,7 +1119,9 @@ box::double_area () const */ template struct box_left +#if __cplusplus < 201703L : public std::unary_function +#endif { typename Box::coord_type operator() (const Box &b) const { @@ -1132,7 +1134,9 @@ struct box_left */ template struct box_right +#if __cplusplus < 201703L : public std::unary_function +#endif { typename Box::coord_type operator() (const Box &b) const { @@ -1145,7 +1149,9 @@ struct box_right */ template struct box_bottom +#if __cplusplus < 201703L : public std::unary_function +#endif { typename Box::coord_type operator() (const Box &b) const { @@ -1158,7 +1164,9 @@ struct box_bottom */ template struct box_top +#if __cplusplus < 201703L : public std::unary_function +#endif { typename Box::coord_type operator() (const Box &b) const { @@ -1171,7 +1179,9 @@ struct box_top */ template struct boxes_overlap +#if __cplusplus < 201703L : public std::binary_function +#endif { bool operator() (const Box &b1, const Box &b2) const { @@ -1184,7 +1194,9 @@ struct boxes_overlap */ template struct boxes_touch +#if __cplusplus < 201703L : public std::binary_function +#endif { bool operator() (const Box &b1, const Box &b2) const { diff --git a/src/db/db/dbBoxScanner.h b/src/db/db/dbBoxScanner.h index 8183396e4..68dd68cf6 100644 --- a/src/db/db/dbBoxScanner.h +++ b/src/db/db/dbBoxScanner.h @@ -44,7 +44,9 @@ namespace db */ template struct bs_side_compare_func - : std::binary_function, std::pair, bool> +#if __cplusplus < 201703L + : std::binary_function, std::pair, bool> +#endif { typedef typename BoxConvert::box_type box_type; @@ -69,7 +71,9 @@ private: */ template struct bs_side_compare_vs_const_func - : std::unary_function, bool> +#if __cplusplus < 201703L + : std::unary_function, bool> +#endif { typedef typename BoxConvert::box_type box_type; typedef typename box_type::coord_type coord_type; diff --git a/src/db/db/dbHierProcessor.cc b/src/db/db/dbHierProcessor.cc index 1bb829fd8..20a82a0f6 100644 --- a/src/db/db/dbHierProcessor.cc +++ b/src/db/db/dbHierProcessor.cc @@ -327,6 +327,17 @@ local_processor_cell_context::local_processor_cell_context (const lo // .. nothing yet .. } +template +local_processor_cell_context & +local_processor_cell_context::operator= (const local_processor_cell_context &other) +{ + if (this != &other) { + m_propagated = other.m_propagated; + m_drops = other.m_drops; + } + return *this; +} + template void local_processor_cell_context::add (db::local_processor_cell_context *parent_context, db::Cell *parent, const db::ICplxTrans &cell_inst) diff --git a/src/db/db/dbHierProcessor.h b/src/db/db/dbHierProcessor.h index 8a4a25f60..7dfc9b3d1 100644 --- a/src/db/db/dbHierProcessor.h +++ b/src/db/db/dbHierProcessor.h @@ -164,6 +164,7 @@ public: local_processor_cell_context (); local_processor_cell_context (const local_processor_cell_context &other); + local_processor_cell_context &operator= (const local_processor_cell_context &other); void add (db::local_processor_cell_context *parent_context, db::Cell *parent, const db::ICplxTrans &cell_inst); void propagate (unsigned int layer, const std::unordered_set &res); @@ -517,7 +518,6 @@ private: void issue_compute_contexts (db::local_processor_contexts &contexts, db::local_processor_cell_context *parent_context, db::Cell *subject_parent, db::Cell *subject_cell, const db::ICplxTrans &subject_cell_inst, const db::Cell *intruder_cell, typename local_processor_cell_contexts::context_key_type &intruders, db::Coord dist) const; void push_results (db::Cell *cell, unsigned int output_layer, const std::unordered_set &result) const; void compute_local_cell (const db::local_processor_contexts &contexts, db::Cell *subject_cell, const db::Cell *intruder_cell, const local_operation *op, const typename local_processor_cell_contexts::context_key_type &intruders, std::vector > &result) const; - std::pair effective_instance (unsigned int subject_layer, db::cell_index_type subject_cell_index, unsigned int intruder_layer, db::cell_index_type intruder_cell_index, const db::ICplxTrans &ti2s, db::Coord dist) const; bool subject_cell_is_breakout (db::cell_index_type ci) const { diff --git a/src/klayout.pri b/src/klayout.pri index 5dcc9b30f..6c8023b46 100644 --- a/src/klayout.pri +++ b/src/klayout.pri @@ -121,8 +121,13 @@ msvc { QMAKE_CXXFLAGS += \ /bigobj \ - /wd4251 \ # Disable "DLL interface required" - /source-charset:utf-8 \ # Use UTF-8 for source files + /wd4251 # Disable "DLL interface required" + + lessThan(QT_MAJOR_VERSION, 6) { + # MSVC 2017 needs this option: + QMAKE_CXXFLAGS += \ + /source-charset:utf-8 \ # Use UTF-8 for source files + } QMAKE_LFLAGS += \ /OPT:NOREF \ # preserves functions we want to keep for implementing the "force link" mechanism