iphlpapi: fix a compiler warning on non-Linux (try 2)
Austin English
austinenglish at gmail.com
Tue Mar 3 12:52:12 CST 2009
AJ's recent work in this area caused a warning on non-Linux OS's,
where this function is not used.
Resending with a proper extension.
--
-Austin
-------------- next part --------------
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index f630906..c752585 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -1297,7 +1297,7 @@ done:
return ret;
}
-
+#ifdef __linux__
static MIB_UDPTABLE *append_udp_row( HANDLE heap, DWORD flags, MIB_UDPTABLE *table,
DWORD *count, const MIB_UDPROW *row )
{
@@ -1317,6 +1317,7 @@ static MIB_UDPTABLE *append_udp_row( HANDLE heap, DWORD flags, MIB_UDPTABLE *tab
memcpy( &table->table[table->dwNumEntries++], row, sizeof(*row) );
return table;
}
+#endif
static int compare_udp_rows(const void *a, const void *b)
{
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index c029e91..b7bedc1 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1270,6 +1270,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
/* callback for wine_mmap_enum_reserved_areas to allocate space for the virtual heap */
+#if !(defined __FreeBSD__)
static int alloc_virtual_heap( void *base, size_t size, void *arg )
{
void **heap_base = arg;
@@ -1280,7 +1281,7 @@ static int alloc_virtual_heap( void *base, size_t size, void *arg )
VIRTUAL_HEAP_SIZE, PROT_READ|PROT_WRITE, MAP_FIXED );
return (*heap_base != (void *)-1);
}
-
+#endif
/***********************************************************************
* virtual_init
*/
@@ -1309,9 +1310,7 @@ void virtual_init(void)
}
}
- /* try to find space in a reserved area for the virtual heap */
- if (!wine_mmap_enum_reserved_areas( alloc_virtual_heap, &heap_base, 1 ))
- heap_base = wine_anon_mmap( NULL, VIRTUAL_HEAP_SIZE, PROT_READ|PROT_WRITE, 0 );
+ heap_base = wine_anon_mmap( (void *)0x81000000, VIRTUAL_HEAP_SIZE, PROT_READ|PROT_WRITE, 0 );
assert( heap_base != (void *)-1 );
virtual_heap = RtlCreateHeap( HEAP_NO_SERIALIZE, heap_base, VIRTUAL_HEAP_SIZE,
More information about the wine-patches
mailing list