My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 3 attachment: winnix.patch (8.2 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
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
Index: run.n
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: include/hx/Thread.h
===================================================================
--- include/hx/Thread.h (revision 259)
+++ include/hx/Thread.h (working copy)
@@ -1,7 +1,7 @@
#ifndef HX_THREAD_H
#define HX_THREAD_H

-#ifdef _MSC_VER
+#ifdef HX_WINDOWS

#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
@@ -13,7 +13,7 @@
#include <sys/time.h>
#endif

-#if defined(_MSC_VER)
+#if defined(HX_WINDOWS)


struct MyMutex
@@ -102,7 +102,7 @@
typedef TAutoLock<MyMutex> AutoLock;


-#if defined(_MSC_VER)
+#if defined(HX_WINDOWS)

struct MySemaphore
{
Index: src/hx/Lib.cpp
===================================================================
--- src/hx/Lib.cpp (revision 259)
+++ src/hx/Lib.cpp (working copy)
@@ -17,7 +17,7 @@
typedef HMODULE Module;

Module hxLoadLibrary(String inLib) { return LoadLibraryW(inLib.__WCStr()); }
-void *hxFindSymbol(Module inModule, const char *inSymbol) { return GetProcAddress(inModule,inSymbol); }
+FARPROC hxFindSymbol(Module inModule, const char *inSymbol) { return GetProcAddress(inModule,inSymbol); }
#elif defined (IPHONE)

typedef void *Module;
Index: src/hx/Thread.cpp
===================================================================
--- src/hx/Thread.cpp (revision 259)
+++ src/hx/Thread.cpp (working copy)
@@ -42,7 +42,7 @@
}
void Clean()
{
- #ifdef _MSC_VER
+ #ifdef HX_WINDOWS
mMutex.Clean();
#endif
mSemaphore.Clean();
@@ -56,7 +56,7 @@
}
#endif

- #ifdef _MSC_VER
+ #ifdef HX_WINDOWS
MyMutex mMutex;
void PushBack(Dynamic inValue)
{
@@ -252,7 +252,7 @@
#ifdef HX_INTERNAL_GC
hx::GCPrepareMultiThreaded();

- #if defined(_MSC_VER)
+ #if defined(HX_WINDOWS)
_beginthreadex(0,0,hxThreadFunc,info,0,0);
#else
pthread_t result;
@@ -261,7 +261,7 @@

#else

- #if defined(_MSC_VER)
+ #if defined(HX_WINDOWS)
GC_beginthreadex(0,0,hxThreadFunc,info,0,0);
#else
pthread_t result;
@@ -438,7 +438,7 @@
hx::InternalFinalizer *mFinalizer;
#endif

- #ifdef _MSC_VER
+ #ifdef HX_WINDOWS
double Now()
{
return (double)clock()/CLOCKS_PER_SEC;
Index: build-tool/BuildTool.hx
===================================================================
--- build-tool/BuildTool.hx (revision 259)
+++ build-tool/BuildTool.hx (working copy)
@@ -913,23 +913,64 @@
}
else if ( (new EReg("window","i")).match(os) )
{
- defines.set("toolchain","msvc");
- defines.set("windows","windows");
- defines.set("BINDIR","Windows");
-
try
{
- var proc = new neko.io.Process("cl.exe",[]);
- var str = proc.stderr.readLine();
+ var proc = new neko.io.Process("uname.exe",["-o"]);
+ var str = proc.stdout.readLine();
proc.close();
- if (str>"")
+ switch (str)
{
- var reg = ~/Version\s+(\d+)/i;
- if (reg.match(str))
- BuildTool.sAllowNumProcs = Std.parseInt(reg.matched(1)) >= 14;
+ case "Msys":
+ defines.set("toolchain","mingw");
+ defines.set("mingw","mingw");
+ defines.set("BINDIR","Windows");
+ case "Cygwin":
+ defines.set("toolchain","cygwin");
+ defines.set("cygwin","cygwin");
+ defines.set("BINDIR","Cygwin");
+ DirManager.sIsCygwin = true;
+ try
+ {
+ (new neko.io.Process("g++.exe",["-o"])).close();
+ }
+ catch(e:Dynamic)
+ {
+ try
+ {
+ (new neko.io.Process("g++-4.exe",["-o"])).close();
+ defines.set("gccver","4");
+ }
+ catch(e:Dynamic)
+ {
+ // If this throws, default back to msvc
+ (new neko.io.Process("g++-3.exe",["-o"])).close();
+ defines.set("gccver","3");
+ }
+ }
+ default:
+ throw( "Unrecognised Windows *nix subsystem" );
}
}
- catch(e:Dynamic){}
+ catch(e:Dynamic)
+ {
+ defines.set("toolchain","msvc");
+ defines.set("windows","windows");
+ defines.set("BINDIR","Windows");
+
+ try
+ {
+ var proc = new neko.io.Process("cl.exe",[]);
+ var str = proc.stderr.readLine();
+ proc.close();
+ if (str>"")
+ {
+ var reg = ~/Version\s+(\d+)/i;
+ if (reg.match(str))
+ BuildTool.sAllowNumProcs = Std.parseInt(reg.matched(1)) >= 14;
+ }
+ }
+ catch(e:Dynamic){}
+ }
}
else if ( (new EReg("linux","i")).match(os) )
{
Index: build-tool/cygwin-toolchain.xml
===================================================================
--- build-tool/cygwin-toolchain.xml (revision 0)
+++ build-tool/cygwin-toolchain.xml (revision 0)
@@ -0,0 +1,46 @@
+<xml>
+
+<!-- CYGWIN TOOLS -------------------------------------->
+
+<include name="gcc-toolchain.xml"/>
+
+<compiler id="cygwin" exe="gcc.exe" if="cygwin">
+ <exe name="gcc-${gccver}.exe" if="gccver"/>
+ <flag value="-c"/>
+ <cppflag value="-frtti"/>
+ <flag value="-g" if="debug"/>
+ <flag value="-O2"/>
+ <flag value="-DHX_LINUX"/>
+ <flag value="-DHXCPP_BOEHM_GC" if="HXCPP_BOEHM_GC"/>
+ <flag value="-DHXCPP_MULTI_THREADED" if="HXCPP_MULTI_THREADED"/>
+ <flag value="-DHX_LITTLE_ENDIAN=0" if="HXCPP_BIG_ENDIAN"/>
+ <flag value="-DHXCPP_DEBUG" if="debug"/>
+ <flag value="-m32" unless="HXCPP_M64"/>
+ <flag value="-I${HXCPP}/include"/>
+ <objdir value="obj/cygwin/" unless="debug"/>
+ <objdir value="obj/cygwin-dbg/" if="debug"/>
+ <outflag value="-o"/>
+ <ext value=".o"/>
+</compiler>
+
+<linker id="dll" exe="g++.exe" if="cygwin">
+ <exe name="g++-${gccver}.exe" if="gccver"/>
+ <flag value="-shared"/>
+ <flag value="-fpic"/>
+ <flag value="-fPIC"/>
+ <flag value="-m32" unless="HXCPP_M64"/>
+ <flag value="-W,l--unresolved-symbols=report-all"/>
+ <flag value="-debug" if="debug"/>
+ <ext value=".dso"/>
+ <outflag value="-o "/>
+</linker>
+
+<linker id="exe" exe="g++.exe" if="cygwin">
+ <exe name="g++-${gccver}.exe" if="gccver"/>
+ <flag value="-debug" if="debug"/>
+ <flag value="-m32" unless="HXCPP_M64"/>
+ <ext value=".exe"/>
+ <outflag value="-o "/>
+</linker>
+
+</xml>
Index: build-tool/mingw-toolchain.xml
===================================================================
--- build-tool/mingw-toolchain.xml (revision 0)
+++ build-tool/mingw-toolchain.xml (revision 0)
@@ -0,0 +1,45 @@
+<xml>
+
+<!-- MINGW TOOLS -------------------------------------->
+
+<include name="gcc-toolchain.xml"/>
+
+<compiler id="mingw" exe="gcc.exe" if="mingw">
+ <flag value="-c"/>
+ <cppflag value="-frtti"/>
+ <flag value="-g" if="debug"/>
+ <flag value="-O2"/>
+ <flag value="-DHX_WINDOWS"/>
+ <flag value="-DHX_LINUX"/>
+ <flag value="-DHXCPP_BOEHM_GC" if="HXCPP_BOEHM_GC"/>
+ <flag value="-DHXCPP_MULTI_THREADED" if="HXCPP_MULTI_THREADED"/>
+ <flag value="-DHX_LITTLE_ENDIAN=0" if="HXCPP_BIG_ENDIAN"/>
+ <flag value="-DHXCPP_DEBUG" if="debug"/>
+ <flag value="-m32" unless="HXCPP_M64"/>
+ <flag value="-I${HXCPP}/include"/>
+ <objdir value="obj/mingw/" unless="debug"/>
+ <objdir value="obj/mingw-dbg/" if="debug"/>
+ <outflag value="-o"/>
+ <ext value=".o"/>
+</compiler>
+
+<linker id="dll" exe="g++.exe" if="mingw">
+ <flag value="-shared"/>
+ <flag value="-fpic"/>
+ <flag value="-fPIC"/>
+ <flag value="-m32" unless="HXCPP_M64"/>
+ <flag value="-W,l--unresolved-symbols=report-all"/>
+ <flag value="-debug" if="debug"/>
+ <ext value=".dll"/>
+ <outflag value="-o "/>
+</linker>
+
+<linker id="exe" exe="g++.exe" if="mingw">
+ <flag value="-debug" if="debug"/>
+ <flag value="-m32" unless="HXCPP_M64"/>
+ <flag value="-static"/>
+ <ext value=".exe"/>
+ <outflag value="-o "/>
+</linker>
+
+</xml>
Powered by Google Project Hosting