File: wxMSW-2.8.10-w64-stc.patch

package info (click to toggle)
libalien-wxwidgets-perl 0.67%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,248 kB
  • ctags: 439
  • sloc: perl: 5,359; sh: 51; makefile: 18
file content (496 lines) | stat: -rw-r--r-- 18,500 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
Index: contrib/include/wx/stc/stc.h
===================================================================
--- contrib/include/wx/stc/stc.h	(revisione 63679)
+++ contrib/include/wx/stc/stc.h	(copia locale)
@@ -3268,7 +3268,7 @@
 
 
     // Send a message to Scintilla
-    long SendMsg(int msg, long wp=0, long lp=0);
+    wxIntPtr SendMsg(int msg, wxUIntPtr wp=0, wxIntPtr lp=0);
 
 
     // Set the vertical scrollbar to use instead of the ont that's built-in.
Index: contrib/src/stc/scintilla/include/Scintilla.h
===================================================================
--- contrib/src/stc/scintilla/include/Scintilla.h	(revisione 63679)
+++ contrib/src/stc/scintilla/include/Scintilla.h	(copia locale)
@@ -28,6 +28,9 @@
 #if defined(_MSC_VER) && _MSC_VER >= 1300
 #include <BaseTsd.h>
 #endif
+#if defined(__MINGW32__)
+#include <windows.h>
+#endif
 #ifdef MAXULONG_PTR
 typedef ULONG_PTR uptr_t;
 typedef LONG_PTR sptr_t;
Index: contrib/src/stc/PlatWX.cpp
===================================================================
--- contrib/src/stc/PlatWX.cpp	(revisione 63679)
+++ contrib/src/stc/PlatWX.cpp	(copia locale)
@@ -1397,7 +1397,7 @@
                                     void *lParam) {
 
     wxStyledTextCtrl* stc = (wxStyledTextCtrl*)w;
-    return stc->SendMsg(msg, wParam, (long)lParam);
+    return stc->SendMsg(msg, wParam, (wxIntPtr)lParam);
 }
 
 
Index: contrib/src/stc/stc.cpp
===================================================================
--- contrib/src/stc/stc.cpp	(revisione 63679)
+++ contrib/src/stc/stc.cpp	(copia locale)
@@ -194,7 +194,7 @@
 
 //----------------------------------------------------------------------
 
-long wxStyledTextCtrl::SendMsg(int msg, long wp, long lp) {
+wxIntPtr wxStyledTextCtrl::SendMsg(int msg, wxUIntPtr wp, wxIntPtr lp) {
 
     return m_swx->WndProc(msg, wp, lp);
 }
@@ -229,17 +229,17 @@
 // Add text to the document at current position.
 void wxStyledTextCtrl::AddText(const wxString& text) {
                     wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
-                    SendMsg(2001, strlen(buf), (long)(const char*)buf);
+                    SendMsg(2001, strlen(buf), (sptr_t)(const char*)buf);
 }
 
 // Add array of cells to document.
 void wxStyledTextCtrl::AddStyledText(const wxMemoryBuffer& data) {
-                          SendMsg(2002, data.GetDataLen(), (long)data.GetData());
+                          SendMsg(2002, data.GetDataLen(), (sptr_t)data.GetData());
 }
 
 // Insert string at a position.
 void wxStyledTextCtrl::InsertText(int pos, const wxString& text) {
-    SendMsg(2003, pos, (long)(const char*)wx2stc(text));
+    SendMsg(2003, pos, (wxIntPtr)(const char*)wx2stc(text));
 }
 
 // Delete all text in the document.
@@ -313,7 +313,7 @@
         tr.lpstrText = (char*)buf.GetWriteBuf(len*2+1);
         tr.chrg.cpMin = startPos;
         tr.chrg.cpMax = endPos;
-        len = SendMsg(2015, 0, (long)&tr);
+        len = SendMsg(2015, 0, (sptr_t)&tr);
         buf.UngetWriteBuf(len);
         return buf;
 }
@@ -388,7 +388,7 @@
         wxMemoryBuffer mbuf(len+1);
         char* buf = (char*)mbuf.GetWriteBuf(len+1);
 
-        int pos = SendMsg(2027, len+1, (long)buf);
+        int pos = SendMsg(2027, len+1, (sptr_t)buf);
         mbuf.UngetWriteBuf(len);
         mbuf.AppendByte(0);
         if (linePos)  *linePos = pos;
@@ -525,7 +525,7 @@
         char* buff = new char[len+1];
         strm.CopyTo(buff, len);
         buff[len] = 0;
-        SendMsg(2049, markerNumber, (long)buff);
+        SendMsg(2049, markerNumber, (sptr_t)buff);
         delete [] buff;
         
 }
@@ -612,7 +612,7 @@
 
 // Set the font of a style.
 void wxStyledTextCtrl::StyleSetFaceName(int style, const wxString& fontName) {
-    SendMsg(2056, style, (long)(const char*)wx2stc(fontName));
+    SendMsg(2056, style, (wxIntPtr)(const char*)wx2stc(fontName));
 }
 
 // Set a style to have its end of line filled or not.
@@ -682,7 +682,7 @@
 
 // Set the styles for a segment of the document.
 void wxStyledTextCtrl::SetStyleBytes(int length, char* styleBytes) {
-        SendMsg(2073, length, (long)styleBytes);
+        SendMsg(2073, length, (sptr_t)styleBytes);
 }
 
 // Set a style to be visible or not.
@@ -703,7 +703,7 @@
 // Set the set of characters making up words for when moving or selecting by word.
 // First sets deaults like SetCharsDefault.
 void wxStyledTextCtrl::SetWordChars(const wxString& characters) {
-    SendMsg(2077, 0, (long)(const char*)wx2stc(characters));
+    SendMsg(2077, 0, (wxIntPtr)(const char*)wx2stc(characters));
 }
 
 // Start a sequence of actions that is undone and redone as a unit.
@@ -806,7 +806,7 @@
 // The lenEntered parameter indicates how many characters before
 // the caret should be used to provide context.
 void wxStyledTextCtrl::AutoCompShow(int lenEntered, const wxString& itemList) {
-    SendMsg(2100, lenEntered, (long)(const char*)wx2stc(itemList));
+    SendMsg(2100, lenEntered, (wxIntPtr)(const char*)wx2stc(itemList));
 }
 
 // Remove the auto-completion list from the screen.
@@ -831,7 +831,7 @@
 
 // Define a set of character that when typed cancel the auto-completion list.
 void wxStyledTextCtrl::AutoCompStops(const wxString& characterSet) {
-    SendMsg(2105, 0, (long)(const char*)wx2stc(characterSet));
+    SendMsg(2105, 0, (wxIntPtr)(const char*)wx2stc(characterSet));
 }
 
 // Change the separator character in the string setting up an auto-completion list.
@@ -847,7 +847,7 @@
 
 // Select the item in the auto-completion list that starts with a string.
 void wxStyledTextCtrl::AutoCompSelect(const wxString& text) {
-    SendMsg(2108, 0, (long)(const char*)wx2stc(text));
+    SendMsg(2108, 0, (wxIntPtr)(const char*)wx2stc(text));
 }
 
 // Should the auto-completion list be cancelled if the user backspaces to a
@@ -864,7 +864,7 @@
 // Define a set of characters that when typed will cause the autocompletion to
 // choose the selected item.
 void wxStyledTextCtrl::AutoCompSetFillUps(const wxString& characterSet) {
-    SendMsg(2112, 0, (long)(const char*)wx2stc(characterSet));
+    SendMsg(2112, 0, (wxIntPtr)(const char*)wx2stc(characterSet));
 }
 
 // Should a single item auto-completion list automatically choose the item.
@@ -889,7 +889,7 @@
 
 // Display a list of strings and send notification when user chooses one.
 void wxStyledTextCtrl::UserListShow(int listType, const wxString& itemList) {
-    SendMsg(2117, listType, (long)(const char*)wx2stc(itemList));
+    SendMsg(2117, listType, (wxIntPtr)(const char*)wx2stc(itemList));
 }
 
 // Set whether or not autocompletion is hidden automatically when nothing matches.
@@ -926,7 +926,7 @@
         char* buff = new char[len+1];
         strm.CopyTo(buff, len);
         buff[len] = 0;
-        SendMsg(2405, type, (long)buff);
+        SendMsg(2405, type, (sptr_t)buff);
         delete [] buff;
      
 }
@@ -1117,7 +1117,7 @@
             wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
             ft.lpstrText = (char*)(const char*)buf;
 
-            return SendMsg(2150, flags, (long)&ft);
+            return SendMsg(2150, flags, (sptr_t)&ft);
 }
 
 // On Windows, will draw the document into a display context such as a printer.
@@ -1148,7 +1148,7 @@
              fr.chrg.cpMin = startPos;
              fr.chrg.cpMax = endPos;
 
-             return SendMsg(2151, doDraw, (long)&fr);
+             return SendMsg(2151, doDraw, (sptr_t)&fr);
 }
 
 // Retrieve the display line at the top of the display.
@@ -1163,7 +1163,7 @@
 
          wxMemoryBuffer mbuf(len+1);
          char* buf = (char*)mbuf.GetWriteBuf(len+1);
-         SendMsg(2153, line, (long)buf);
+         SendMsg(2153, line, (sptr_t)buf);
          mbuf.UngetWriteBuf(len);
          mbuf.AppendByte(0);
          return stc2wx(buf);
@@ -1215,7 +1215,7 @@
 
          wxMemoryBuffer mbuf(len+2);
          char* buf = (char*)mbuf.GetWriteBuf(len+1);
-         SendMsg(2161, 0, (long)buf);
+         SendMsg(2161, 0, (sptr_t)buf);
          mbuf.UngetWriteBuf(len);
          mbuf.AppendByte(0);
          return stc2wx(buf);
@@ -1236,7 +1236,7 @@
          tr.lpstrText = buf;
          tr.chrg.cpMin = startPos;
          tr.chrg.cpMax = endPos;
-         SendMsg(2162, 0, (long)&tr);
+         SendMsg(2162, 0, (sptr_t)&tr);
          mbuf.UngetWriteBuf(len);
          mbuf.AppendByte(0);
          return stc2wx(buf);
@@ -1269,7 +1269,7 @@
 
 // Replace the selected text with the argument text.
 void wxStyledTextCtrl::ReplaceSelection(const wxString& text) {
-    SendMsg(2170, 0, (long)(const char*)wx2stc(text));
+    SendMsg(2170, 0, (wxIntPtr)(const char*)wx2stc(text));
 }
 
 // Set to read only or read write.
@@ -1319,7 +1319,7 @@
 
 // Replace the contents of the document with the argument text.
 void wxStyledTextCtrl::SetText(const wxString& text) {
-    SendMsg(2181, 0, (long)(const char*)wx2stc(text));
+    SendMsg(2181, 0, (wxIntPtr)(const char*)wx2stc(text));
 }
 
 // Retrieve all the text in the document.
@@ -1327,7 +1327,7 @@
          int len  = GetTextLength();
          wxMemoryBuffer mbuf(len+1);   // leave room for the null...
          char* buf = (char*)mbuf.GetWriteBuf(len+1);
-         SendMsg(2182, len+1, (long)buf);
+         SendMsg(2182, len+1, (sptr_t)buf);
          mbuf.UngetWriteBuf(len);
          mbuf.AppendByte(0);
          return stc2wx(buf);
@@ -1386,7 +1386,7 @@
 
      int wxStyledTextCtrl::ReplaceTarget(const wxString& text) {
          wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
-         return SendMsg(2194, strlen(buf), (long)(const char*)buf);
+         return SendMsg(2194, strlen(buf), (sptr_t)(const char*)buf);
 }
 
 // Replace the target text with the argument text after \d processing.
@@ -1398,7 +1398,7 @@
 
      int wxStyledTextCtrl::ReplaceTargetRE(const wxString& text) {
          wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
-         return SendMsg(2195, strlen(buf), (long)(const char*)buf);
+         return SendMsg(2195, strlen(buf), (sptr_t)(const char*)buf);
 }
 
 // Search for a counted string in the target and set the target to the found
@@ -1407,7 +1407,7 @@
 
      int wxStyledTextCtrl::SearchInTarget(const wxString& text) {
          wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
-         return SendMsg(2197, strlen(buf), (long)(const char*)buf);
+         return SendMsg(2197, strlen(buf), (sptr_t)(const char*)buf);
 }
 
 // Set the search flags used by SearchInTarget.
@@ -1422,7 +1422,7 @@
 
 // Show a call tip containing a definition near position pos.
 void wxStyledTextCtrl::CallTipShow(int pos, const wxString& definition) {
-    SendMsg(2200, pos, (long)(const char*)wx2stc(definition));
+    SendMsg(2200, pos, (wxIntPtr)(const char*)wx2stc(definition));
 }
 
 // Remove the call tip from the screen.
@@ -1652,7 +1652,7 @@
 // NUL terminated text argument.
 // Does not handle tab or control characters.
 int wxStyledTextCtrl::TextWidth(int style, const wxString& text) {
-    return SendMsg(2276, style, (long)(const char*)wx2stc(text));
+    return SendMsg(2276, style, (wxIntPtr)(const char*)wx2stc(text));
 }
 
 // Sets the scroll range so that maximum scroll position has
@@ -1686,7 +1686,7 @@
 // Append a string to the end of the document without changing the selection.
 void wxStyledTextCtrl::AppendText(const wxString& text) {
                     wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
-                    SendMsg(2282, strlen(buf), (long)(const char*)buf);
+                    SendMsg(2282, strlen(buf), (sptr_t)(const char*)buf);
 }
 
 // Is drawing done in two phases with backgrounds drawn before foregrounds?
@@ -2050,7 +2050,7 @@
 
 // Change the document object used.
 void wxStyledTextCtrl::SetDocPointer(void* docPointer) {
-         SendMsg(2358, 0, (long)docPointer);
+         SendMsg(2358, 0, (sptr_t)docPointer);
 }
 
 // Set which document modification events are sent to the container.
@@ -2099,13 +2099,13 @@
 // Find some text starting at the search anchor.
 // Does not ensure the selection is visible.
 int wxStyledTextCtrl::SearchNext(int flags, const wxString& text) {
-    return SendMsg(2367, flags, (long)(const char*)wx2stc(text));
+    return SendMsg(2367, flags, (wxIntPtr)(const char*)wx2stc(text));
 }
 
 // Find some text starting at the search anchor and moving backwards.
 // Does not ensure the selection is visible.
 int wxStyledTextCtrl::SearchPrev(int flags, const wxString& text) {
-    return SendMsg(2368, flags, (long)(const char*)wx2stc(text));
+    return SendMsg(2368, flags, (wxIntPtr)(const char*)wx2stc(text));
 }
 
 // Retrieves the number of lines completely visible.
@@ -2143,12 +2143,12 @@
 
 // Extend life of document.
 void wxStyledTextCtrl::AddRefDocument(void* docPointer) {
-         SendMsg(2376, 0, (long)docPointer);
+         SendMsg(2376, 0, (sptr_t)docPointer);
 }
 
 // Release a reference to the document, deleting document if it fades to black.
 void wxStyledTextCtrl::ReleaseDocument(void* docPointer) {
-         SendMsg(2377, 0, (long)docPointer);
+         SendMsg(2377, 0, (sptr_t)docPointer);
 }
 
 // Get which document modification events are sent to the container.
@@ -2333,7 +2333,7 @@
 
 // Copy argument text to the clipboard.
 void wxStyledTextCtrl::CopyText(int length, const wxString& text) {
-    SendMsg(2420, length, (long)(const char*)wx2stc(text));
+    SendMsg(2420, length, (wxIntPtr)(const char*)wx2stc(text));
 }
 
 // Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or
@@ -2447,7 +2447,7 @@
 // Set the set of characters making up whitespace for when moving or selecting by word.
 // Should be called after SetWordChars.
 void wxStyledTextCtrl::SetWhitespaceChars(const wxString& characters) {
-    SendMsg(2443, 0, (long)(const char*)wx2stc(characters));
+    SendMsg(2443, 0, (wxIntPtr)(const char*)wx2stc(characters));
 }
 
 // Reset the set of characters for whitespace and word characters to the defaults.
@@ -2538,27 +2538,27 @@
 
 // Set up a value that may be used by a lexer for some optional feature.
 void wxStyledTextCtrl::SetProperty(const wxString& key, const wxString& value) {
-    SendMsg(4004, (long)(const char*)wx2stc(key), (long)(const char*)wx2stc(value));
+    SendMsg(4004, (wxIntPtr)(const char*)wx2stc(key), (wxIntPtr)(const char*)wx2stc(value));
 }
 
 // Set up the key words used by the lexer.
 void wxStyledTextCtrl::SetKeyWords(int keywordSet, const wxString& keyWords) {
-    SendMsg(4005, keywordSet, (long)(const char*)wx2stc(keyWords));
+    SendMsg(4005, keywordSet, (wxIntPtr)(const char*)wx2stc(keyWords));
 }
 
 // Set the lexing language of the document based on string name.
 void wxStyledTextCtrl::SetLexerLanguage(const wxString& language) {
-    SendMsg(4006, 0, (long)(const char*)wx2stc(language));
+    SendMsg(4006, 0, (wxIntPtr)(const char*)wx2stc(language));
 }
 
 // Retrieve a 'property' value previously set with SetProperty.
 wxString wxStyledTextCtrl::GetProperty(const wxString& key) {
-         int len = SendMsg(SCI_GETPROPERTY, (long)(const char*)wx2stc(key), (long)NULL);
+         int len = SendMsg(SCI_GETPROPERTY, (sptr_t)(const char*)wx2stc(key), (sptr_t)NULL);
          if (!len) return wxEmptyString;
 
          wxMemoryBuffer mbuf(len+1);
          char* buf = (char*)mbuf.GetWriteBuf(len+1);
-         SendMsg(4008, (long)(const char*)wx2stc(key), (long)buf);
+         SendMsg(4008, (sptr_t)(const char*)wx2stc(key), (sptr_t)buf);
          mbuf.UngetWriteBuf(len);
          mbuf.AppendByte(0);
          return stc2wx(buf);
@@ -2567,12 +2567,12 @@
 // Retrieve a 'property' value previously set with SetProperty,
 // with '$()' variable replacement on returned buffer.
 wxString wxStyledTextCtrl::GetPropertyExpanded(const wxString& key) {
-         int len = SendMsg(SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2stc(key), (long)NULL);
+         int len = SendMsg(SCI_GETPROPERTYEXPANDED, (sptr_t)(const char*)wx2stc(key), (sptr_t)NULL);
          if (!len) return wxEmptyString;
 
          wxMemoryBuffer mbuf(len+1);
          char* buf = (char*)mbuf.GetWriteBuf(len+1);
-         SendMsg(4009, (long)(const char*)wx2stc(key), (long)buf);
+         SendMsg(4009, (sptr_t)(const char*)wx2stc(key), (sptr_t)buf);
          mbuf.UngetWriteBuf(len);
          mbuf.AppendByte(0);
          return stc2wx(buf);
@@ -2581,7 +2581,7 @@
 // Retrieve a 'property' value previously set with SetProperty,
 // interpreted as an int AFTER any '$()' variable replacement.
 int wxStyledTextCtrl::GetPropertyInt(const wxString& key) {
-    return SendMsg(4010, (long)(const char*)wx2stc(key), 0);
+    return SendMsg(4010, (wxIntPtr)(const char*)wx2stc(key), 0);
 }
 
 // Retrieve the number of bits the current lexer needs for styling.
@@ -2919,12 +2919,12 @@
 
 void wxStyledTextCtrl::AddTextRaw(const char* text)
 {
-    SendMsg(SCI_ADDTEXT, strlen(text), (long)text);
+    SendMsg(SCI_ADDTEXT, strlen(text), (sptr_t)text);
 }
 
 void wxStyledTextCtrl::InsertTextRaw(int pos, const char* text)
 {
-    SendMsg(SCI_INSERTTEXT, pos, (long)text);
+    SendMsg(SCI_INSERTTEXT, pos, (sptr_t)text);
 }
 
 wxCharBuffer wxStyledTextCtrl::GetCurLineRaw(int* linePos)
@@ -2937,7 +2937,7 @@
     }
 
     wxCharBuffer buf(len);
-    int pos = SendMsg(SCI_GETCURLINE, len, (long)buf.data());
+    int pos = SendMsg(SCI_GETCURLINE, len, (sptr_t)buf.data());
     if (linePos)  *linePos = pos;
     return buf;
 }
@@ -2951,7 +2951,7 @@
     }
 
     wxCharBuffer buf(len);
-    SendMsg(SCI_GETLINE, line, (long)buf.data());
+    SendMsg(SCI_GETLINE, line, (sptr_t)buf.data());
     return buf;
 }
 
@@ -2968,7 +2968,7 @@
     }        
 
     wxCharBuffer buf(len);
-    SendMsg(SCI_GETSELTEXT, 0, (long)buf.data());
+    SendMsg(SCI_GETSELTEXT, 0, (sptr_t)buf.data());
     return buf;
 }
 
@@ -2990,26 +2990,26 @@
     tr.lpstrText = buf.data();
     tr.chrg.cpMin = startPos;
     tr.chrg.cpMax = endPos;
-    SendMsg(SCI_GETTEXTRANGE, 0, (long)&tr);
+    SendMsg(SCI_GETTEXTRANGE, 0, (sptr_t)&tr);
     return buf;
 }
 
 void wxStyledTextCtrl::SetTextRaw(const char* text)
 {
-    SendMsg(SCI_SETTEXT, 0, (long)text);
+    SendMsg(SCI_SETTEXT, 0, (sptr_t)text);
 }
 
 wxCharBuffer wxStyledTextCtrl::GetTextRaw()
 {
     int len  = GetTextLength();
     wxCharBuffer buf(len);
-    SendMsg(SCI_GETTEXT, len+1, (long)buf.data());
+    SendMsg(SCI_GETTEXT, len+1, (sptr_t)buf.data());
     return buf;
 }
 
 void wxStyledTextCtrl::AppendTextRaw(const char* text)
 {
-    SendMsg(SCI_APPENDTEXT, strlen(text), (long)text);
+    SendMsg(SCI_APPENDTEXT, strlen(text), (sptr_t)text);
 }