Robert Roessler wrote:
Joseph Galbraith wrote:
Please find attached two patches which enable both
scintilla.dll and scite.exe to be build using VS.NET
2005 (or the platform SDK 64 bit compiler.)
>
You might want to generate these against the current CVS versions of the files... the second one was already changed by Neil on September 18 to use the const. :)

Okay... here it is.

scintalla.1.patch:

+ Make definition of Edit::NotifyMacroRecord() match it's
  declaration.

+ Fix declaration of ListBoxX::StaticWndProc to match
  PSDK for a WNDPROC.

+ Use {Set,Get}WindowPointerPtr instead of
  {Set,Get}WindowPointer and the new GWLP_USERDATA
  and GWLP_WNDPROC instead of old GWL_USERDATA and
  GWL_WNDPROC where needed.

scintilla.2.patch:

+ Add -D_CRT_SECURE_NO_DEPRECATE=1 to make files to suppress
  warnings about functions Microsoft deems unsafe (such
  a strcpy, strncpy, etc.)

Thanks,

Joseph
Index: scintilla/src/Editor.cxx
===================================================================
--- scintilla/src/Editor.cxx    (revision 889)
+++ scintilla/src/Editor.cxx    (working copy)
@@ -3777,7 +3777,7 @@
        /* Do nothing */
 }
 
-void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, 
long lParam) {
+void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t 
lParam) {
 
        // Enumerates all macroable messages
        switch (iMessage) {
Index: scintilla/win32/PlatWin.cxx
===================================================================
--- scintilla/win32/PlatWin.cxx (revision 889)
+++ scintilla/win32/PlatWin.cxx (working copy)
@@ -1056,7 +1056,7 @@
        virtual void SetList(const char *list, char separator, char typesep);
        void Draw(DRAWITEMSTRUCT *pDrawItem);
        long WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam);
-       static long PASCAL StaticWndProc(HWND hWnd, UINT iMessage, WPARAM 
wParam, LPARAM lParam);
+       static LRESULT CALLBACK StaticWndProc(HWND hWnd, UINT iMessage, WPARAM 
wParam, LPARAM lParam);
 };
 
 const Point ListBoxX::ItemInset(0, 0);
@@ -1602,7 +1602,7 @@
                return 0;
        }
 
-       WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(GetWindowLong(hWnd, 
GWL_USERDATA));
+       WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hWnd, 
GWLP_USERDATA));
        if (prevWndProc) {
                return ::CallWindowProc(prevWndProc, hWnd, uMsg, wParam, 
lParam);
        } else {
@@ -1624,8 +1624,8 @@
                                reinterpret_cast<HMENU>(ctrlID),
                                hinstanceParent,
                                0);
-                       WNDPROC prevWndProc = 
reinterpret_cast<WNDPROC>(::SetWindowLong(lb, GWL_WNDPROC, 
reinterpret_cast<LONG>(ControlWndProc)));
-                       ::SetWindowLong(lb, GWL_USERDATA, 
reinterpret_cast<LONG>(prevWndProc));
+                       WNDPROC prevWndProc = 
reinterpret_cast<WNDPROC>(::SetWindowLongPtr(lb, GWLP_WNDPROC, 
reinterpret_cast<LONG_PTR>(ControlWndProc)));
+                       ::SetWindowLongPtr(lb, GWLP_USERDATA, 
reinterpret_cast<LONG_PTR>(prevWndProc));
                }
                break;
 
@@ -1715,7 +1715,7 @@
        return 0;
 }
 
-long PASCAL ListBoxX::StaticWndProc(
+LRESULT CALLBACK ListBoxX::StaticWndProc(
     HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) {
        if (iMessage == WM_CREATE) {
                CREATESTRUCT *pCreate = reinterpret_cast<CREATESTRUCT 
*>(lParam);
Index: scite/win32/DirectorExtension.cxx
===================================================================
--- scite/win32/DirectorExtension.cxx   (revision 889)
+++ scite/win32/DirectorExtension.cxx   (working copy)
@@ -161,8 +161,8 @@
        if (!wReceiver)
                ::exit(FALSE);
        // Make the frame window handle available so the director can activate 
it.
-       ::SetWindowLong(wReceiver, GWL_USERDATA,
-               reinterpret_cast<LONG>(((SciTEBase*)host)->GetID()));
+       ::SetWindowLongPtr(wReceiver, GWLP_USERDATA,
+               reinterpret_cast<LONG_PTR>(((SciTEBase*)host)->GetID()));
        CheckEnvironment(host);
        return true;
 }
Index: scite/win32/SciTEWinDlg.cxx
===================================================================
--- scite/win32/SciTEWinDlg.cxx (revision 889)
+++ scite/win32/SciTEWinDlg.cxx (working copy)
@@ -77,9 +77,9 @@
 
 static SciTEWin *Caller(HWND hDlg, UINT message, LPARAM lParam) {
        if (message == WM_INITDIALOG) {
-               SetWindowLong(hDlg, DWL_USER, lParam);
+               SetWindowLongPtr(hDlg, DWLP_USER, lParam);
        }
-       return reinterpret_cast<SciTEWin*>(GetWindowLong(hDlg, DWL_USER));
+       return reinterpret_cast<SciTEWin*>(GetWindowLongPtr(hDlg, DWLP_USER));
 }
 
 void SciTEWin::WarnUser(int warnID) {
Index: scite/win32/SingleThreadExtension.cxx
===================================================================
--- scite/win32/SingleThreadExtension.cxx       (revision 889)
+++ scite/win32/SingleThreadExtension.cxx       (working copy)
@@ -28,13 +28,13 @@
        STE_WM_ONEXECUTE = 2001
 };
 
-LRESULT PASCAL SingleThreadExtension::WndProc(HWND hwnd, UINT uMsg, WPARAM 
wParam, LPARAM lParam) {
+LRESULT CALLBACK SingleThreadExtension::WndProc(HWND hwnd, UINT uMsg, WPARAM 
wParam, LPARAM lParam) {
        if (uMsg == STE_WM_ONEXECUTE) {
                Extension *extension = reinterpret_cast<Extension *>(wParam);
                return extension->OnExecute(reinterpret_cast<char *>(lParam));
        }
 
-       WNDPROC lpPrevWndProc = reinterpret_cast<WNDPROC>(GetWindowLong(hwnd, 
GWL_USERDATA));
+       WNDPROC lpPrevWndProc = 
reinterpret_cast<WNDPROC>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
        if (lpPrevWndProc)
                return ::CallWindowProc(lpPrevWndProc, hwnd, uMsg, wParam, 
lParam);
 
@@ -47,8 +47,8 @@
                0, 0, 0, 0, 0, 0, 0, GetModuleHandle(NULL), 0
        );
 
-       LONG subclassedProc = SetWindowLong(hwndDispatcher, GWL_WNDPROC, 
reinterpret_cast<LONG>(WndProc));
-       SetWindowLong(hwndDispatcher, GWL_USERDATA, subclassedProc);
+       LONG_PTR subclassedProc = SetWindowLongPtr(hwndDispatcher, 
GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(WndProc));
+       SetWindowLongPtr(hwndDispatcher, GWLP_USERDATA, subclassedProc);
 
        return ext->Initialise(host_);
 }
Index: scite/win32/UniqueInstance.cxx
===================================================================
--- scite/win32/UniqueInstance.cxx      (revision 889)
+++ scite/win32/UniqueInstance.cxx      (working copy)
@@ -223,7 +223,7 @@
  */
 BOOL CALLBACK UniqueInstance::SearchOtherInstance(HWND hWnd, LPARAM lParam) {
        BOOL bResult = TRUE;
-       DWORD result;
+       DWORD_PTR result;
 
        UniqueInstance *ui = reinterpret_cast<UniqueInstance *>(lParam);
 
Index: scintilla/win32/scintilla.mak
===================================================================
--- scintilla/win32/scintilla.mak       (revision 889)
+++ scintilla/win32/scintilla.mak       (working copy)
@@ -35,7 +35,7 @@
 RC=rc
 LD=link
 
-CXXFLAGS=-Zi -TP -W4 -Zc:forScope -Zc:wchar_t
+CXXFLAGS=-Zi -TP -W4 -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1
 # For something scary:-Wp64
 CXXDEBUG=-Od -MTd -DDEBUG
 CXXNDEBUG=-O1 -MT -DNDEBUG -GL
Index: scite/win32/scite.mak
===================================================================
--- scite/win32/scite.mak       (revision 889)
+++ scite/win32/scite.mak       (working copy)
@@ -35,7 +35,7 @@
 RC=rc
 LD=link
 
-CXXFLAGS=-Zi -TP -W4 -Zc:forScope -Zc:wchar_t
+CXXFLAGS=-Zi -TP -W4 -Zc:forScope -Zc:wchar_t -D_CRT_SECURE_NO_DEPRECATE=1
 CCFLAGS=-TC -W3
 
 # For something scary:-Wp64
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to