diff -urN node-v0.10.29.orig/deps/cares/cares.gyp node-v0.10.29/deps/cares/cares.gyp --- node-v0.10.29.orig/deps/cares/cares.gyp 2014-07-26 12:09:40.312412400 +0100 +++ node-v0.10.29/deps/cares/cares.gyp 2014-07-26 12:10:17.545140300 +0100 @@ -114,8 +114,8 @@ 'src/ares_platform.c' ], 'libraries': [ - '-lws2_32.lib', - '-liphlpapi.lib' + '-lws2_32', + '-liphlpapi' ], }, { # Not Windows i.e. POSIX diff -urN node-v0.10.29.orig/deps/openssl/openssl.gyp node-v0.10.29/deps/openssl/openssl.gyp --- node-v0.10.29.orig/deps/openssl/openssl.gyp 2014-07-26 12:09:49.738609300 +0100 +++ node-v0.10.29/deps/openssl/openssl.gyp 2014-07-26 12:10:17.553141300 +0100 @@ -941,8 +941,8 @@ ], 'link_settings': { 'libraries': [ - '-lgdi32.lib', - '-luser32.lib', + '-lgdi32', + '-luser32', ] } }, { diff -urN node-v0.10.29.orig/deps/uv/include/uv-private/uv-win.h node-v0.10.29/deps/uv/include/uv-private/uv-win.h --- node-v0.10.29.orig/deps/uv/include/uv-private/uv-win.h 2014-07-26 12:09:41.398550300 +0100 +++ node-v0.10.29/deps/uv/include/uv-private/uv-win.h 2014-07-26 12:10:17.554141500 +0100 @@ -34,6 +34,11 @@ #include #include +#ifndef __MINGW64_VERSION_MAJOR +typedef PVOID RTL_SRWLOCK; +typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; +#endif + #include #include #include diff -urN node-v0.10.29.orig/deps/uv/src/win/core.c node-v0.10.29/deps/uv/src/win/core.c --- node-v0.10.29.orig/deps/uv/src/win/core.c 2014-07-26 12:09:41.460558200 +0100 +++ node-v0.10.29/deps/uv/src/win/core.c 2014-07-26 12:10:17.555141600 +0100 @@ -55,7 +55,7 @@ /* Tell the CRT to not exit the application when an invalid parameter is */ /* passed. The main issue is that invalid FDs will trigger this behavior. */ -#if !defined(__MINGW32__) || __MSVCRT_VERSION__ >= 0x800 +#if !defined(__MINGW32__) || (defined (_MSC_VER) && __MSVCRT_VERSION__ >= 0x800) _set_invalid_parameter_handler(uv__crt_invalid_parameter_handler); #endif diff -urN node-v0.10.29.orig/deps/uv/src/win/pipe.c node-v0.10.29/deps/uv/src/win/pipe.c --- node-v0.10.29.orig/deps/uv/src/win/pipe.c 2014-07-26 12:09:41.455557500 +0100 +++ node-v0.10.29/deps/uv/src/win/pipe.c 2014-07-26 12:10:17.556641800 +0100 @@ -30,6 +30,9 @@ #include "stream-inl.h" #include "req-inl.h" +#ifndef FILE_FLAG_FIRST_PIPE_INSTANCE +#define FILE_FLAG_FIRST_PIPE_INSTANCE 524288 +#endif /* A zero-size buffer for use by uv_pipe_read */ static char uv_zero_[] = ""; diff -urN node-v0.10.29.orig/deps/uv/src/win/process.c node-v0.10.29/deps/uv/src/win/process.c --- node-v0.10.29.orig/deps/uv/src/win/process.c 2014-07-26 12:09:41.456057600 +0100 +++ node-v0.10.29/deps/uv/src/win/process.c 2014-07-26 12:10:17.557641900 +0100 @@ -30,6 +30,9 @@ #include "handle-inl.h" #include "req-inl.h" +#ifndef JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE +#define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 0x2000 +#endif #define SIGKILL 9 diff -urN node-v0.10.29.orig/deps/uv/uv.gyp node-v0.10.29/deps/uv/uv.gyp --- node-v0.10.29.orig/deps/uv/uv.gyp 2014-07-26 12:09:40.477433300 +0100 +++ node-v0.10.29/deps/uv/uv.gyp 2014-07-26 12:10:17.558642000 +0100 @@ -110,11 +110,11 @@ ], 'link_settings': { 'libraries': [ - '-ladvapi32.lib', - '-liphlpapi.lib', - '-lpsapi.lib', - '-lshell32.lib', - '-lws2_32.lib' + '-ladvapi32', + '-liphlpapi', + '-lpsapi', + '-lshell32', + '-lws2_32' ], }, }, { # Not Windows i.e. POSIX @@ -376,7 +376,7 @@ 'test/runner-win.c', 'test/runner-win.h' ], - 'libraries': [ 'ws2_32.lib' ] + 'libraries': [ 'ws2_32' ] }, { # POSIX 'defines': [ '_GNU_SOURCE' ], 'sources': [ @@ -440,7 +440,7 @@ 'test/runner-win.c', 'test/runner-win.h', ], - 'libraries': [ 'ws2_32.lib' ] + 'libraries': [ 'ws2_32' ] }, { # POSIX 'defines': [ '_GNU_SOURCE' ], 'sources': [ diff -urN node-v0.10.29.orig/deps/v8/tools/gyp/v8.gyp node-v0.10.29/deps/v8/tools/gyp/v8.gyp --- node-v0.10.29.orig/deps/v8/tools/gyp/v8.gyp 2014-07-26 12:09:39.918362300 +0100 +++ node-v0.10.29/deps/v8/tools/gyp/v8.gyp 2014-07-26 12:10:17.559642200 +0100 @@ -737,7 +737,7 @@ ], 'msvs_disabled_warnings': [4351, 4355, 4800], 'link_settings': { - 'libraries': [ '-lwinmm.lib', '-lws2_32.lib' ], + 'libraries': [ '-lwinmm', '-lws2_32' ], }, }], ['component=="shared_library"', { diff -urN node-v0.10.29.orig/node.gyp node-v0.10.29/node.gyp --- node-v0.10.29.orig/node.gyp 2014-07-26 12:09:37.571564300 +0100 +++ node-v0.10.29/node.gyp 2014-07-26 12:10:17.562142500 +0100 @@ -260,7 +260,7 @@ 'PLATFORM="win32"', '_UNICODE=1', ], - 'libraries': [ '-lpsapi.lib' ] + 'libraries': [ '-municode', '-lpsapi' ] }, { # POSIX 'defines': [ '__POSIX__' ], }], diff -urN node-v0.10.29.orig/src/node_internals.h node-v0.10.29/src/node_internals.h --- node-v0.10.29.orig/src/node_internals.h 2014-07-26 12:09:37.587066300 +0100 +++ node-v0.10.29/src/node_internals.h 2014-07-26 12:10:17.563142600 +0100 @@ -34,7 +34,7 @@ // Defined in node.cc at startup. extern v8::Persistent process; -#ifdef _WIN32 +#ifdef _MSC_VER // emulate snprintf() on windows, _snprintf() doesn't zero-terminate the buffer // on overflow... #include diff -urN node-v0.10.29.orig/src/node_main.cc node-v0.10.29/src/node_main.cc --- node-v0.10.29.orig/src/node_main.cc 2014-07-26 12:09:37.576565000 +0100 +++ node-v0.10.29/src/node_main.cc 2014-07-26 12:10:17.564642800 +0100 @@ -21,7 +21,10 @@ #include "node.h" -#ifdef _WIN32 +#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) +#if defined (__cplusplus) && defined(__MINGW64_VERSION_MAJOR) +extern "C" { +#endif int wmain(int argc, wchar_t *wargv[]) { // Convert argv to to UTF8 char** argv = new char*[argc]; @@ -59,6 +62,9 @@ // Now that conversion is done, we can finally start. return node::Start(argc, argv); } +#if defined (__cplusplus) && defined(__MINGW64_VERSION_MAJOR) +} +#endif #else // UNIX int main(int argc, char *argv[]) {