aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx3
-rw-r--r--src/RunStyles.cxx9
2 files changed, 7 insertions, 5 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 04486d4c6..3e9deb934 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -21,6 +21,7 @@
#include <optional>
#include <algorithm>
#include <memory>
+#include <type_traits>
#include "ScintillaTypes.h"
@@ -215,7 +216,7 @@ public:
}
void InsertLines(Sci::Line line, const Sci::Position *positions, size_t lines, bool lineStart) override {
const POS lineAsPos = pos_cast(line);
- if constexpr (sizeof(Sci::Position) == sizeof(POS)) {
+ if constexpr (std::is_convertible_v<Sci::Position *, POS *>) {
starts.InsertPartitions(lineAsPos, positions, lines);
} else {
starts.InsertPartitionsWithCast(lineAsPos, positions, lines);
diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx
index 848670ba9..4fac2c2b3 100644
--- a/src/RunStyles.cxx
+++ b/src/RunStyles.cxx
@@ -319,9 +319,10 @@ void RunStyles<DISTANCE, STYLE>::Check() const {
}
}
+// should also cover all possible types underlying ptrdiff_t (Sci::Position)
template class Scintilla::Internal::RunStyles<int, int>;
template class Scintilla::Internal::RunStyles<int, char>;
-#if (PTRDIFF_MAX != INT_MAX) || defined(__HAIKU__)
-template class Scintilla::Internal::RunStyles<ptrdiff_t, int>;
-template class Scintilla::Internal::RunStyles<ptrdiff_t, char>;
-#endif
+template class Scintilla::Internal::RunStyles<long, int>;
+template class Scintilla::Internal::RunStyles<long, char>;
+template class Scintilla::Internal::RunStyles<long long, int>;
+template class Scintilla::Internal::RunStyles<long long, char>;