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.)

The first patch fixes the build errors:

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

+ In ColouriseCamlDoc, SCE_CAML_OPERATOR, strchr() returns
  a const char*; so make o const char* instead of char*.

+ 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.

The second patch is very small and disable the compiler
warning generated when using C runtime library functions
that MS deems unsafe, like strcpy, strncpy, etc., etc., etc.

I wasn't able to figure out how to tweak the manifest file
for scite.exe to work w/ windows 64... so we aren't all
the way there yet.  However, if I disabled the manifest,
I was able to at least launch scite.exe.  I didn't do much
more testing than this.

Thanks,

Joseph
Index: E:/Users/Galb/Projects/projects/scintilla/win32/PlatWin.cxx
===================================================================
--- E:/Users/Galb/Projects/projects/scintilla/win32/PlatWin.cxx (revision 886)
+++ E:/Users/Galb/Projects/projects/scintilla/win32/PlatWin.cxx (revision 887)
@@ -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: E:/Users/Galb/Projects/projects/scintilla/src/LexCaml.cxx
===================================================================
--- E:/Users/Galb/Projects/projects/scintilla/src/LexCaml.cxx   (revision 886)
+++ E:/Users/Galb/Projects/projects/scintilla/src/LexCaml.cxx   (revision 887)
@@ -273,7 +273,7 @@
 
                case SCE_CAML_OPERATOR: {
                        // [try to] interpret as [additional] operator char
-                       char* o = 0;
+                       const char* o = 0;
                        if (iscaml(ch) || isspace(ch)                   /* 
ident or whitespace */
                                || ((o = strchr(")]};,\'\"`#", ch)) != 0)/* 
"termination" chars */
                                || !strchr("!$%&*+-./:<=>[EMAIL PROTECTED]|~", 
ch)/* "operator" chars */) {
Index: E:/Users/Galb/Projects/projects/scintilla/src/Editor.cxx
===================================================================
--- E:/Users/Galb/Projects/projects/scintilla/src/Editor.cxx    (revision 886)
+++ E:/Users/Galb/Projects/projects/scintilla/src/Editor.cxx    (revision 887)
@@ -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: E:/Users/Galb/Projects/projects/scite/win32/UniqueInstance.cxx
===================================================================
--- E:/Users/Galb/Projects/projects/scite/win32/UniqueInstance.cxx      
(revision 886)
+++ E:/Users/Galb/Projects/projects/scite/win32/UniqueInstance.cxx      
(revision 887)
@@ -224,7 +224,7 @@
  */
 BOOL CALLBACK UniqueInstance::SearchOtherInstance(HWND hWnd, LPARAM lParam) {
        BOOL bResult = TRUE;
-       DWORD result;
+       DWORD_PTR result;
 
        UniqueInstance *ui = reinterpret_cast<UniqueInstance *>(lParam);
 
Index: E:/Users/Galb/Projects/projects/scite/win32/SingleThreadExtension.cxx
===================================================================
--- E:/Users/Galb/Projects/projects/scite/win32/SingleThreadExtension.cxx       
(revision 886)
+++ E:/Users/Galb/Projects/projects/scite/win32/SingleThreadExtension.cxx       
(revision 887)
@@ -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: E:/Users/Galb/Projects/projects/scite/win32/DirectorExtension.cxx
===================================================================
--- E:/Users/Galb/Projects/projects/scite/win32/DirectorExtension.cxx   
(revision 886)
+++ E:/Users/Galb/Projects/projects/scite/win32/DirectorExtension.cxx   
(revision 887)
@@ -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: E:/Users/Galb/Projects/projects/scite/win32/SciTEWinDlg.cxx
===================================================================
--- E:/Users/Galb/Projects/projects/scite/win32/SciTEWinDlg.cxx (revision 886)
+++ E:/Users/Galb/Projects/projects/scite/win32/SciTEWinDlg.cxx (revision 887)
@@ -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: E:/Users/Galb/Projects/projects/scintilla/win32/scintilla.mak
===================================================================
--- E:/Users/Galb/Projects/projects/scintilla/win32/scintilla.mak       
(revision 887)
+++ E:/Users/Galb/Projects/projects/scintilla/win32/scintilla.mak       
(revision 888)
@@ -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: E:/Users/Galb/Projects/projects/scite/win32/scite.mak
===================================================================
--- E:/Users/Galb/Projects/projects/scite/win32/scite.mak       (revision 887)
+++ E:/Users/Galb/Projects/projects/scite/win32/scite.mak       (revision 888)
@@ -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