forked from SublimeCodeIntel/SublimeCodeIntel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathosx.patch
More file actions
122 lines (109 loc) · 4.13 KB
/
osx.patch
File metadata and controls
122 lines (109 loc) · 4.13 KB
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
--- macosx/makefile 2007-12-19 17:28:02.000000000 -0800
+++ macosx/makefile 2007-12-19 17:30:28.000000000 -0800
@@ -14,10 +14,10 @@
grep version | cut -d' ' -f3 | cut -d'.' -f1)
# We call it "libscintilla" so when you add it to a Project Builder project,
# Project Builder will link it correctly.
-STATICLIB=../bin/libscintilla.a
-DYNAMICLIB=../bin/libscintilla.dylib
+STATICLIB=libscintilla.a
+DYNAMICLIB=libscintilla.dylib
vpath %.h ../src ../include ../lexlib
vpath %.cxx ../src ../lexlib ../lexers
@@ -28,12 +28,14 @@
# on a 10.3 or older PPC box
ARCHFLAGS=-arch ppc -faltivec -mcpu=7400 -mtune=7400 -mpowerpc -mpowerpc-gfxopt
else
ifndef NATIVE
-ARCH_BASE_FLAGS=/Developer/SDKs/MacOSX10.6.sdk -arch i386
+ARCH_BASE_FLAGS=/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386
ARCHFLAGS=-isysroot $(ARCH_BASE_FLAGS)
LINK_FLAGS=-Wl,-syslibroot,$(ARCH_BASE_FLAGS)
-DYN_FLAGS=$(LINK_FLAGS) -framework Carbon -bundle
+DYN_FLAGS=$(LINK_FLAGS) -framework Carbon -framework Cocoa -install_name @executable_path/$(DYNAMICLIB)
+else
+DYN_FLAGS=$(LDFLAGS) -arch i386 -framework Carbon -framework Cocoa -install_name @executable_path/$(DYNAMICLIB)
endif
endif
OPTIONS=-Wall -Wno-missing-braces -Wno-char-subscripts -DSCI_NAMESPACE -DMACOSX -DSCI_LEXER
@@ -61,14 +63,16 @@
$(CC) $(CXXFLAGS) $(OPTIONS) $(DFLAGS) $(CONTAINER) $(ARCHFLAGS) $(EXT_INPUT) $(INCLUDEDIRS) -c $<
.c.o:
$(CCOMP) $(CXXFLAGS) $(OPTIONS) $(DFLAGS) $(CONTAINER) $(ARCHFLAGS) $(EXT_INPUT) $(INCLUDEDIRS) -w -c $<
+.m.o:
+ $(CC) $(CXXFLAGS) $(OPTIONS) $(DFLAGS) $(CONTAINER) $(ARCHFLAGS) $(EXT_INPUT) $(INCLUDEDIRS) -c $<
LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
# The LEXOBJS have to be treated specially as the functions in them are not called from external code
-all: $(STATICLIB) $(LEXOBJS)
+all: ../bin/$(STATICLIB) $(LEXOBJS)
-shared: $(DYNAMICLIB) $(LEXOBJS)
+shared: ../bin/$(DYNAMICLIB) $(LEXOBJS)
clean:
rm -f *.o $(COMPLIB)
@@ -96,12 +98,12 @@
TCarbonEvent.o TView.o ScintillaCallTip.o $(EXTOBS) \
$(LEXOBJS)
-$(STATICLIB): $(COMPLIB)
+../bin/$(STATICLIB): $(COMPLIB) libpcre.a
$(LIBTOOL) -static -o $@ $^
-$(DYNAMICLIB): $(COMPLIB)
- $(CC) -dynamic -o $@ $(DYN_FLAGS) $^
+../bin/$(DYNAMICLIB): $(COMPLIB) libpcre.a
+ $(CC) -dynamiclib -o $@ $(DYN_FLAGS) $^
# Generate header files from Scintilla.iface
../include/Scintilla_gen.h: ../include/HFacer.py ../include/Face.py ../include/Scintilla.iface
cd ../include && python HFacer.py
--- macosx/PlatMacOSX.cxx 2010-01-29 22:00:10.000000000 -0800
+++ macosx/PlatMacOSX.cxx 2010-02-01 15:00:00.000000000 -0800
@@ -1765,8 +1765,13 @@
long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) {
return scintilla_send_message( w, msg, wParam, lParam );
}
+long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) {
+ return scintilla_send_message(w, msg, wParam,
+ reinterpret_cast<sptr_t>(lParam));
+}
+
bool Platform::IsDBCSLeadByte(int /*codePage*/, char /*ch*/) {
// TODO: Implement this for code pages != UTF-8
return false;
}
@@ -1849,4 +1854,38 @@
if (val < minVal)
val = minVal;
return val;
}
+
+#include <dlfcn.h>
+class DynamicLibraryImpl : public DynamicLibrary {
+protected:
+ void* m;
+public:
+ DynamicLibraryImpl(const char *modulePath) {
+ m = dlopen(modulePath, RTLD_LAZY);
+ }
+
+ virtual ~DynamicLibraryImpl() {
+ if (m != NULL)
+ dlclose(m);
+ }
+
+ virtual Function FindFunction(const char *name) {
+ if (m != NULL) {
+ void *fn_address = dlsym(m, name);
+ if (fn_address)
+ return static_cast<Function>(fn_address);
+ else
+ return NULL;
+ } else
+ return NULL;
+ }
+
+ virtual bool IsValid() {
+ return m != NULL;
+ }
+};
+
+DynamicLibrary *DynamicLibrary::Load(const char *modulePath) {
+ return static_cast<DynamicLibrary *>( new DynamicLibraryImpl(modulePath) );
+}