Don't #include <tlhelp32.h> when compiling with gcc, as it isn't provided.

2000-07-19  Tor Lillqvist  <tml@iki.fi>

* gmodule-win32.c: Don't #include <tlhelp32.h> when compiling with gcc, as it
isn't provided. Declaration of a needed struct (from
www.microsoft.com) inserted instead.
This commit is contained in:
Tor Lillqvist 2000-07-18 20:24:29 +00:00 committed by Tor Lillqvist
parent 9556b49053
commit 93b1001c10
2 changed files with 35 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2000-07-19 Tor Lillqvist <tml@iki.fi>
* gmodule-win32.c: Don't #include <tlhelp32.h> when compiling with
gcc, as it isn't provided. Declaration of a needed struct (from
www.microsoft.com) inserted instead.
2000-05-13 Tor Lillqvist <tml@iki.fi>
* makefile.mingw.in: New file, with gmodule stuff

View File

@ -33,7 +33,34 @@
#include <stdio.h>
#include <windows.h>
#ifdef __MSVC__
#include <tlhelp32.h>
#else
/* The w32api headers supplied with the mingw gcc don't have
* tlhelp32.h. We really only need the MODULEENTRY32 struct and the
* TH32CS_SNAPMODULE value, so provide them here.
*/
#define MAX_MODULE_NAME32 255
typedef struct
{
DWORD dwSize;
DWORD th32ModuleID;
DWORD th32ProcessID;
DWORD GlblcntUsage;
DWORD ProccntUsage;
BYTE *modBaseAddr;
DWORD modBaseSize;
HMODULE hModule;
char szModule[MAX_MODULE_NAME32 + 1];
char szExePath[MAX_PATH];
} MODULEENTRY32;
#define TH32CS_SNAPMODULE 8
#endif
static void
set_error (void)
@ -82,10 +109,10 @@ find_in_any_module_using_toolhelp (const gchar *symbol_name)
typedef HANDLE (WINAPI *PFNCREATETOOLHELP32SNAPSHOT)(DWORD, DWORD);
static PFNCREATETOOLHELP32SNAPSHOT pfnCreateToolhelp32Snapshot = NULL;
typedef BOOL (WINAPI *PFNMODULE32FIRST)(HANDLE, LPMODULEENTRY32);
typedef BOOL (WINAPI *PFNMODULE32FIRST)(HANDLE, MODULEENTRY32*);
static PFNMODULE32FIRST pfnModule32First= NULL;
typedef BOOL (WINAPI *PFNMODULE32NEXT)(HANDLE, LPMODULEENTRY32);
typedef BOOL (WINAPI *PFNMODULE32NEXT)(HANDLE, MODULEENTRY32*);
static PFNMODULE32NEXT pfnModule32Next = NULL;
static HMODULE kernel32;