Skip to content

Commit

Permalink
Rust-specific: disable pieces of windows build that don't exist on mi…
Browse files Browse the repository at this point in the history
…ngw.
  • Loading branch information
graydon committed Feb 3, 2012
1 parent 65bbf02 commit 1170ffb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/win/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ int uv_udp_set_broadcast(uv_udp_t* handle, int value) {

SOCKOPT_SETTER(multicast_loop, IP_MULTICAST_LOOP, IPV6_MULTICAST_LOOP)
SOCKOPT_SETTER(multicast_ttl, IP_MULTICAST_TTL, IPV6_MULTICAST_HOPS)
SOCKOPT_SETTER(ttl, IP_TTL, IPV6_HOPLIMIT)
#ifndef __MINGW32__
SOCKOPT_SETTER(ttl, IP_TTL, IPV6_HOPLIMIT)
#endif

#undef SOCKOPT_SETTER
10 changes: 10 additions & 0 deletions src/win/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ uv_err_t uv_resident_set_memory(size_t* rss) {
HANDLE current_process;
PROCESS_MEMORY_COUNTERS pmc;

#ifdef __MINGW32__

*rss = 0;

#else

current_process = GetCurrentProcess();

if (!GetProcessMemoryInfo(current_process, &pmc, sizeof(pmc))) {
Expand All @@ -380,6 +386,8 @@ uv_err_t uv_resident_set_memory(size_t* rss) {

*rss = pmc.WorkingSetSize;

#endif

return uv_ok_;
}

Expand Down Expand Up @@ -484,6 +492,7 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
free(cpu_infos);
}

#ifndef __MINGW32__

uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
int* count) {
Expand Down Expand Up @@ -579,6 +588,7 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
return uv_ok_;
}

#endif

void uv_free_interface_addresses(uv_interface_address_t* addresses,
int count) {
Expand Down

1 comment on commit 1170ffb

@luislavena
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graydon what version of MinGW are you using? Have you tried mingw-w64? (even it says w64, is both x86 and x64 bits) Their headers and support libraries are way better than original mingw.org ones.

Please sign in to comment.