From a7b6d06cd4cd4a101398d5c1d9782bd068292e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 17 Jul 2015 23:33:35 -0700 Subject: [PATCH] Scintilla: Fixed Linux build. --- 3rdparty/scintilla/include/Platform.h | 10 ++++++++-- 3rdparty/scintilla/lexlib/LexerNoExceptions.cxx | 2 ++ 3rdparty/scintilla/src/CellBuffer.cxx | 2 ++ 3rdparty/scintilla/src/RunStyles.cxx | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/3rdparty/scintilla/include/Platform.h b/3rdparty/scintilla/include/Platform.h index 4ef7e2aab..9c9253d25 100644 --- a/3rdparty/scintilla/include/Platform.h +++ b/3rdparty/scintilla/include/Platform.h @@ -65,7 +65,7 @@ #undef PLAT_MACOSX #define PLAT_MACOSX 1 -#else +#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN64) #undef PLAT_WIN #define PLAT_WIN 1 @@ -526,8 +526,14 @@ public: } #endif -#if defined(__GNUC__) && defined(SCINTILLA_QT) +#if defined(__GNUC__) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif +#if defined(__EXCEPTIONS) +#else +# define try if (1) +# define catch(...) else if (0) +#endif + #endif diff --git a/3rdparty/scintilla/lexlib/LexerNoExceptions.cxx b/3rdparty/scintilla/lexlib/LexerNoExceptions.cxx index 9ebae2af0..84c4fd26b 100644 --- a/3rdparty/scintilla/lexlib/LexerNoExceptions.cxx +++ b/3rdparty/scintilla/lexlib/LexerNoExceptions.cxx @@ -24,6 +24,8 @@ #include "LexerBase.h" #include "LexerNoExceptions.h" +#include "Platform.h" + #ifdef SCI_NAMESPACE using namespace Scintilla; #endif diff --git a/3rdparty/scintilla/src/CellBuffer.cxx b/3rdparty/scintilla/src/CellBuffer.cxx index dfa1350c0..b5b3f17e9 100644 --- a/3rdparty/scintilla/src/CellBuffer.cxx +++ b/3rdparty/scintilla/src/CellBuffer.cxx @@ -787,10 +787,12 @@ const Action &CellBuffer::GetUndoStep() const { void CellBuffer::PerformUndoStep() { const Action &actionStep = uh.GetUndoStep(); if (actionStep.at == insertAction) { +#if defined(__EXCEPTIONS) if (substance.Length() < actionStep.lenData) { throw std::runtime_error( "CellBuffer::PerformUndoStep: deletion must be less than document length."); } +#endif // defined(__EXCEPTIONS) BasicDeleteChars(actionStep.position, actionStep.lenData); } else if (actionStep.at == removeAction) { BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData); diff --git a/3rdparty/scintilla/src/RunStyles.cxx b/3rdparty/scintilla/src/RunStyles.cxx index ad8d977d6..4a0dde50a 100644 --- a/3rdparty/scintilla/src/RunStyles.cxx +++ b/3rdparty/scintilla/src/RunStyles.cxx @@ -260,6 +260,7 @@ int RunStyles::Find(int value, int start) const { } void RunStyles::Check() const { +#if defined(__EXCEPTIONS) if (Length() < 0) { throw std::runtime_error("RunStyles: Length can not be negative."); } @@ -285,4 +286,5 @@ void RunStyles::Check() const { throw std::runtime_error("RunStyles: Style of a partition same as previous."); } } +#endif // defined(__EXCEPTIONS) }