aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/ScintillaWin.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-04 16:21:09 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-04 16:21:09 +1000
commita6dd4eeab87d2562bd6280c594e01869e0bc4aa1 (patch)
tree8e54c0ee625433c6b081d784a4fcba19bbd3f30e /win32/ScintillaWin.cxx
parentc1886dc599e9d985abef06d8779cfc90478c9ebd (diff)
downloadscintilla-mirror-a6dd4eeab87d2562bd6280c594e01869e0bc4aa1.tar.gz
Move DLL entry points DllMain and Scintilla_DirectFunction into ScintillaDLL.cxx
to simplify build process by eliminating the compilation of ScintillaWin.cxx into ScintillaWinS.o|obj.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r--win32/ScintillaWin.cxx34
1 files changed, 12 insertions, 22 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 73d8f370c..81ebdfaa8 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -90,6 +90,7 @@
#include "PlatWin.h"
#include "HanjaDic.h"
+#include "ScintillaWin.h"
#ifndef SPI_GETWHEELSCROLLLINES
#define SPI_GETWHEELSCROLLLINES 104
@@ -3383,15 +3384,15 @@ sptr_t ScintillaWin::DirectFunction(
return reinterpret_cast<ScintillaWin *>(ptr)->WndProc(iMessage, wParam, lParam);
}
-extern "C"
-#ifndef STATIC_BUILD
-__declspec(dllexport)
-#endif
-sptr_t __stdcall Scintilla_DirectFunction(
+namespace Scintilla {
+
+sptr_t DirectFunction(
ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam) {
return sci->WndProc(iMessage, wParam, lParam);
}
+}
+
LRESULT PASCAL ScintillaWin::SWndProc(
HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) {
//Platform::DebugPrintf("S W:%x M:%x WP:%x L:%x\n", hWnd, iMessage, wParam, lParam);
@@ -3436,28 +3437,17 @@ int Scintilla_RegisterClasses(void *hInstance) {
return result;
}
-static int ResourcesRelease(bool fromDllMain) {
+namespace Scintilla {
+
+int ResourcesRelease(bool fromDllMain) {
const bool result = ScintillaWin::Unregister();
Platform_Finalise(fromDllMain);
return result;
}
+}
+
// This function is externally visible so it can be called from container when building statically.
int Scintilla_ReleaseResources() {
- return ResourcesRelease(false);
-}
-
-#ifndef STATIC_BUILD
-extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved) {
- //Platform::DebugPrintf("Scintilla::DllMain %d %d\n", hInstance, dwReason);
- if (dwReason == DLL_PROCESS_ATTACH) {
- if (!Scintilla_RegisterClasses(hInstance))
- return FALSE;
- } else if (dwReason == DLL_PROCESS_DETACH) {
- if (lpvReserved == NULL) {
- ResourcesRelease(true);
- }
- }
- return TRUE;
+ return Scintilla::ResourcesRelease(false);
}
-#endif