Permalink
Browse files

fix windows build

  • Loading branch information...
1 parent ec1bea3 commit c47de2e0ba692b15216e082319a48ce3e574e2a1 @kersny committed Aug 10, 2011
Showing with 19 additions and 9 deletions.
  1. +8 −0 src/Libuv/TcpSocket.cs
  2. +11 −9 winbuild.bat
View
@@ -8,7 +8,11 @@ static uv_buf_t alloc_cb(IntPtr tcp, IntPtr size)
{
uv_buf_t buf;
buf.data = Marshal.AllocHGlobal(size);
+ #if __MonoCS__
buf.len = size;
+ #else
+ buf.len = (ulong)size;
+ #endif
return buf;
}
static void unmanaged_read_cb(IntPtr stream, IntPtr nread, uv_buf_t buf)
@@ -110,7 +114,11 @@ public void Write(byte[] data, int length)
IntPtr dat = dataptrhandle.AddrOfPinnedObject();
uv_buf_t[] buf = new uv_buf_t[1];
buf[0].data = dat;
+ #if __MonoCS__
buf[0].len = (IntPtr)length;
+ #else
+ buf[0].len = (ulong)length;
+ #endif
var req = (uv_req_t)Marshal.PtrToStructure(write_request, typeof(uv_req_t));
req.data = dat;
Marshal.StructureToPtr(req, write_request, true);
View
@@ -6,25 +6,27 @@ IF %1==clean (
GOTO Build
)
:Build
- del src\wrapper\uv_wrap.def
- echo LIBRARY UVWRAP >> src\wrapper\uv_wrap.def
- echo EXPORTS >> src\wrapper\uv_wrap.def
+ del uv.def
+ echo LIBRARY UVWRAP >> uv.def
+ echo EXPORTS >> uv.def
set count=0
setlocal ENABLEDELAYEDEXPANSION
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! >> src\wrapper\uv_wrap.def
+ echo %%e @!count! >> uv.def
)
- for /f %%b IN ('msbuildpath.exe') do %%bMSBuild.exe deps\libuv\msvs\libuv.sln
+ call "deps\libuv\create-msvs-files.bat"
+ cd ../..
+ for /f %%b IN ('msbuildpath.exe') do %%bMSBuild.exe deps\libuv\build\all.sln
call "%VS100COMNTOOLS%vsvars32.bat"
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
+ "%VCINSTALLDIR%bin\cl.exe" /o build\uv.dll deps\libuv\build\Debug\obj\uv\*.obj ws2_32.lib advapi32.lib /link /DLL /DEF:uv.def
GOTO Done
:Clean
+ rmdir /S /Q deps\libuv\build\Debug
rmdir /S /Q build
- rmdir /S /Q deps\libuv\build
del /Q uv_wrap.obj
- del /Q src\wrapper\uv_wrap.def
+ del /Q uv_wrap.def
GOTO Done
:Done
-echo on
+echo on

0 comments on commit c47de2e

Please sign in to comment.