aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-12-14 08:09:58 +1100
committerNeil <nyamatongwe@gmail.com>2019-12-14 08:09:58 +1100
commitb9b5cf4cb81c03c1871a40becbe9b4d7807ad600 (patch)
tree6e0ccf8880133db9a9fff7bada5c9df5637ee263
parentb6d260731bddb23d63f4a0990305b1d9501f7cf8 (diff)
downloadscintilla-mirror-b9b5cf4cb81c03c1871a40becbe9b4d7807ad600.tar.gz
Backport: Remove links to lexers with SCI_EMPTYCATALOGUE definition.
This allows building a version of SciTE that is statically linked to Scintilla and does not include any lexers but allows the use of lexers provided by loading a DLL. Backport of changeset 7867:f17a228be4d8.
-rw-r--r--doc/ScintillaDoc.html3
-rw-r--r--doc/ScintillaHistory.html3
-rw-r--r--src/Catalogue.cxx4
3 files changed, 10 insertions, 0 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index fa247b35e..d6d98b578 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -6830,6 +6830,9 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
styling and fold points for an unsupported language you can either do this in the container or
better still, write your own lexer following the pattern of one of the existing ones.</p>
+ <p>If the symbol <code>SCI_EMPTYCATALOGUE</code> is defined when building
+ Scintilla, then no lexers are made available but other lexing support code may be present.</p>
+
<p>Scintilla also supports external lexers. These are DLLs (on Windows), .dylib modules (on macOS),
or .so modules (on GTK/Linux) that export three
functions: <code>GetLexerCount</code>, <code>GetLexerName</code>, and
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index ea72b9ecb..308c1d40c 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -563,6 +563,9 @@
<li>
SCI_LOADLEXERLIBRARY implemented on Cocoa.
</li>
+ <li>
+ Build Scintilla with SCI_EMPTYCATALOGUE to avoid making lexers available.
+ </li>
</ul>
<h3>
<a href="https://sourceforge.net/projects/scintilla/files/scintilla/3.11.2/scintilla3112.zip/download">Release 3.11.2</a>
diff --git a/src/Catalogue.cxx b/src/Catalogue.cxx
index 919ecf668..9e0ab2921 100644
--- a/src/Catalogue.cxx
+++ b/src/Catalogue.cxx
@@ -53,6 +53,8 @@ int Scintilla_LinkLexers() {
return 0;
initialised = 1;
+#if !defined(SCI_EMPTYCATALOGUE)
+
// Shorten the code that declares a lexer and ensures it is linked in by calling a method.
#define LINK_LEXER(lexer) extern LexerModule lexer; catalogueDefault.AddLexerModule(&lexer);
@@ -189,5 +191,7 @@ int Scintilla_LinkLexers() {
//--Autogenerated -- end of automatically generated section
+#endif
+
return 1;
}