libs/wine: fix compiler warnings on mingw
Austin English
austinenglish at gmail.com
Thu Jul 1 11:42:56 CDT 2010
../../../wineclean/libs/wine/loader.c:52: warning: function
declaration isn’t a prototype
../../../wineclean/libs/wine/loader.c:314: warning: ‘fixup_imports’
defined but not used
../../../wineclean/libs/wine/loader.c:335: warning: ‘fixup_exports’
defined but not used
../../../wineclean/libs/wine/loader.c:347: warning: ‘fixup_resources’
defined but not used
../../../wineclean/libs/wine/loader.c:646: warning: ‘set_max_limit’
defined but not used
--
-Austin
-------------- next part --------------
diff --git a/libs/wine/loader.c b/libs/wine/loader.c
index 37c603e..077e29a 100644
--- a/libs/wine/loader.c
+++ b/libs/wine/loader.c
@@ -45,9 +45,11 @@
#include "winbase.h"
#include "wine/library.h"
-#ifdef __APPLE__
+#if defined (__APPLE__)
#include <crt_externs.h>
#define environ (*_NSGetEnviron())
+#elif defined (__MINGW32__)
+extern _CRTIMP char *** __cdecl __MINGW_NOTHROW __p__environ(void);
#else
extern char **environ;
#endif
@@ -309,7 +311,8 @@ static inline void fixup_rva_dwords( DWORD *ptr, int delta, unsigned int count )
}
}
-
+/* These three functions are only used within HAVE_MMAP block below */
+#ifdef HAVE_MMAP
/* fixup RVAs in the import directory */
static void fixup_imports( IMAGE_IMPORT_DESCRIPTOR *dir, BYTE *base, int delta )
{
@@ -361,7 +364,7 @@ static void fixup_resources( IMAGE_RESOURCE_DIRECTORY *dir, BYTE *root, int delt
}
}
}
-
+#endif /* HAVE_MMAP */
/* map a builtin dll in memory and fixup RVAs */
static void *map_dll( const IMAGE_NT_HEADERS *nt_descr )
@@ -643,6 +646,7 @@ int wine_dll_get_owner( const char *name, char *buffer, int size, int *exists )
*
* Set a user limit to the maximum allowed value.
*/
+#if defined(RLIMIT_NOFILE) || defined RLIMIT_AS
static void set_max_limit( int limit )
{
#ifdef HAVE_SETRLIMIT
@@ -661,12 +665,12 @@ static void set_max_limit( int limit )
rlimit.rlim_cur = OPEN_MAX;
setrlimit( limit, &rlimit );
}
-#endif
+#endif /* __APPLE__ */
}
}
-#endif
+#endif /* HAVE_SETRLIMIT */
}
-
+#endif /* RLIMIT_NOFILE || RLIMIT_AS */
/***********************************************************************
* wine_init
More information about the wine-patches
mailing list