Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix build for windows

  • Loading branch information...
commit f1e65a9c6196d4437f4ba15e8bacd40967994660 1 parent 51d2769
@kersny authored
View
2  .gitmodules
@@ -1,3 +1,3 @@
[submodule "libuv"]
- path = libuv
+ path = deps/libuv
url = git://github.com/joyent/libuv.git
View
4 src/Libuv/TcpEntity.cs
@@ -66,7 +66,7 @@ public void Close()
int err = uv_close(this.Handle, (x) => {
this.Dispose();
});
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void uv_connection_cb(IntPtr socket, int status);
@@ -81,6 +81,6 @@ public void Close()
[DllImport ("uvwrap")]
internal static extern int uv_close(IntPtr handle, uv_close_cb cb);
[DllImport ("uvwrap")]
- internal static extern uv_err_t uv_last_err();
+ internal static extern uv_err_t uv_last_error();
}
}
View
6 src/Libuv/TcpServer.cs
@@ -5,16 +5,16 @@ public class TcpServer : TcpEntity {
public TcpServer() : base()
{
int err = uv_tcp_init(this.Handle);
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
}
public void Listen(string ip, int port, Action<TcpSocket> OnConnect)
{
int err = manos_uv_tcp_bind(this.Handle, ip, port);
- if (err != 0 ) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0 ) throw new Exception(uv_last_error().code.ToString());
err = uv_tcp_listen(this.Handle, 128, (sock, status) => {
OnConnect(new TcpSocket(this.Handle));
});
- if (err != 0 ) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0 ) throw new Exception(uv_last_error().code.ToString());
}
[DllImport ("uvwrap")]
internal static extern int manos_uv_tcp_bind (IntPtr socket, string host, int port);
View
14 src/Libuv/TcpSocket.cs
@@ -11,21 +11,21 @@ public TcpSocket()
{
this.Connection = manos_uv_connect_t_create();
int err = uv_tcp_init(this.Handle);
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
}
public TcpSocket(IntPtr ServerHandle) : base()
{
int err = uv_tcp_init(this.Handle);
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
err = uv_accept(ServerHandle, this.Handle);
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
err = manos_uv_read_start(this.Handle, (socket, count, data) => {
RaiseData(data, count);
}, () => {
RaiseClose();
this.Dispose();
});
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
}
private void RaiseData(byte[] data, int count)
{
@@ -57,15 +57,15 @@ public void Connect(string ip, int port, Action OnConnect)
RaiseClose();
this.Dispose();
});
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
OnConnect();
});
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
}
public void Write(byte[] data, int length)
{
int err = manos_uv_write(this.Handle, data, length);
- if (err != 0) throw new Exception(uv_last_err().code.ToString());
+ if (err != 0) throw new Exception(uv_last_error().code.ToString());
}
public new void Dispose()
{
View
20 winbuild.bat
@@ -6,25 +6,25 @@ IF %1==clean (
GOTO Build
)
:Build
- del uv_wrap.def
- echo LIBRARY UVWRAP >> uv_wrap.def
- echo EXPORTS >> uv_wrap.def
+ del src\wrapper\uv_wrap.def
+ echo LIBRARY UVWRAP >> src\wrapper\uv_wrap.def
+ echo EXPORTS >> src\wrapper\uv_wrap.def
set count=0
setlocal ENABLEDELAYEDEXPANSION
- for /f "tokens=1,2,3,4,5 delims=( " %%a in ('findstr "extern" webserver.cs') do (
+ for /f "tokens=1,2,3,4,5 delims=( " %%a in ('findstr "extern" src\Libuv\*.cs src\Libuv.Tests\*.cs') do (
set /a count=count+1
- echo %%e @!count! >> uv_wrap.def
+ echo %%e @!count! >> src\wrapper\uv_wrap.def
)
- for /f %%b IN ('msbuildpath.exe') do %%bMSBuild.exe libuv\msvs\libuv.sln
+ for /f %%b IN ('msbuildpath.exe') do %%bMSBuild.exe deps\libuv\msvs\libuv.sln
call "%VS100COMNTOOLS%vsvars32.bat"
- FOR /F %%a IN ('msbuildpath.exe') DO %%aMSBuild.exe webserver.csproj
- "%VCINSTALLDIR%bin\cl.exe" uv_wrap.c /o build/uvwrap.dll libuv/build/Win32/Debug/libuv.lib ws2_32.lib advapi32.lib /link /DLL /DEF:uv_wrap.def
+ FOR /F %%a IN ('msbuildpath.exe') DO %%aMSBuild.exe src\Libuv.sln
+ "%VCINSTALLDIR%bin\cl.exe" src\wrapper\uv_wrap.c /o build\uvwrap.dll deps\libuv\build\Win32\Debug\libuv.lib ws2_32.lib advapi32.lib /link /DLL /DEF:src\wrapper\uv_wrap.def
GOTO Done
:Clean
rmdir /S /Q build
- rmdir /S /Q libuv\build
+ rmdir /S /Q deps\libuv\build
del /Q uv_wrap.obj
- del /Q uv_wrap.def
+ del /Q src\wrapper\uv_wrap.def
GOTO Done
:Done
echo on
Please sign in to comment.
Something went wrong with that request. Please try again.