diff options
author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2025-10-08 19:15:29 +0300 |
---|---|---|
committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2025-10-08 19:15:29 +0300 |
commit | a493d638574ac81d3b7c8210b9ff5089d52e65fc (patch) | |
tree | 29b41b9eac0d6c4d5a862614e941d6d3cca8a444 | |
parent | 0953ffeee80abdd8e79ddacc7066eb02c78968e7 (diff) | |
download | scintilla-mirror-a493d638574ac81d3b7c8210b9ff5089d52e65fc.tar.gz |
Revert "support ptrdiff_t if it has the same storage size as int, but does *not* alias it"
This reverts commit 0953ffeee80abdd8e79ddacc7066eb02c78968e7.
-rw-r--r-- | src/CellBuffer.cxx | 3 | ||||
-rw-r--r-- | src/RunStyles.cxx | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 3e9deb934..04486d4c6 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -21,7 +21,6 @@ #include <optional> #include <algorithm> #include <memory> -#include <type_traits> #include "ScintillaTypes.h" @@ -216,7 +215,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 (std::is_convertible_v<Sci::Position *, POS *>) { + if constexpr (sizeof(Sci::Position) == sizeof(POS)) { starts.InsertPartitions(lineAsPos, positions, lines); } else { starts.InsertPartitionsWithCast(lineAsPos, positions, lines); diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index 4fac2c2b3..848670ba9 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -319,10 +319,9 @@ 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>; -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>; +#if (PTRDIFF_MAX != INT_MAX) || defined(__HAIKU__) +template class Scintilla::Internal::RunStyles<ptrdiff_t, int>; +template class Scintilla::Internal::RunStyles<ptrdiff_t, char>; +#endif |