New function. Returns the Windows version code like GetVersion(), except

2004-08-25  Tor Lillqvist  <tml@iki.fi>

	* glib/gwin32.c (g_win32_get_windows_version): New
	function. Returns the Windows version code like GetVersion(),
	except that one can pretend to be running on Win9x by setting the
	G_WIN32_PRETEND_WIN9X environment variable. This is mainly for
	debugging purposed.

	* glib/gwin32.h: Declare it. Define macros G_WIN32_WINDOWS_IS_NT_BASED
	and G_WIN32_HAVE_WIDECHAR_API to test Windows features at run-time.
This commit is contained in:
Tor Lillqvist 2004-08-25 15:32:50 +00:00 committed by Tor Lillqvist
parent 0d0f7c9c98
commit 1de0e063fe
7 changed files with 77 additions and 0 deletions

View File

@ -1,3 +1,14 @@
2004-08-25 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_get_windows_version): New
function. Returns the Windows version code like GetVersion(),
except that one can pretend to be running on Win9x by setting the
G_WIN32_PRETEND_WIN9X environment variable. This is mainly for
debugging purposed.
* glib/gwin32.h: Declare it. Define macros G_WIN32_WINDOWS_IS_NT_BASED
and G_WIN32_HAVE_WIDECHAR_API to test Windows features at run-time.
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* configure.in: Post-release version bump.

View File

@ -1,3 +1,14 @@
2004-08-25 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_get_windows_version): New
function. Returns the Windows version code like GetVersion(),
except that one can pretend to be running on Win9x by setting the
G_WIN32_PRETEND_WIN9X environment variable. This is mainly for
debugging purposed.
* glib/gwin32.h: Declare it. Define macros G_WIN32_WINDOWS_IS_NT_BASED
and G_WIN32_HAVE_WIDECHAR_API to test Windows features at run-time.
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* configure.in: Post-release version bump.

View File

@ -1,3 +1,14 @@
2004-08-25 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_get_windows_version): New
function. Returns the Windows version code like GetVersion(),
except that one can pretend to be running on Win9x by setting the
G_WIN32_PRETEND_WIN9X environment variable. This is mainly for
debugging purposed.
* glib/gwin32.h: Declare it. Define macros G_WIN32_WINDOWS_IS_NT_BASED
and G_WIN32_HAVE_WIDECHAR_API to test Windows features at run-time.
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* configure.in: Post-release version bump.

View File

@ -1,3 +1,14 @@
2004-08-25 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_get_windows_version): New
function. Returns the Windows version code like GetVersion(),
except that one can pretend to be running on Win9x by setting the
G_WIN32_PRETEND_WIN9X environment variable. This is mainly for
debugging purposed.
* glib/gwin32.h: Declare it. Define macros G_WIN32_WINDOWS_IS_NT_BASED
and G_WIN32_HAVE_WIDECHAR_API to test Windows features at run-time.
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* configure.in: Post-release version bump.

View File

@ -1,3 +1,14 @@
2004-08-25 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_get_windows_version): New
function. Returns the Windows version code like GetVersion(),
except that one can pretend to be running on Win9x by setting the
G_WIN32_PRETEND_WIN9X environment variable. This is mainly for
debugging purposed.
* glib/gwin32.h: Declare it. Define macros G_WIN32_WINDOWS_IS_NT_BASED
and G_WIN32_HAVE_WIDECHAR_API to test Windows features at run-time.
2004-08-25 Matthias Clasen <mclasen@redhat.com>
* configure.in: Post-release version bump.

View File

@ -1297,3 +1297,20 @@ g_win32_get_package_installation_subdirectory (gchar *package,
return dirname;
}
guint
g_win32_get_windows_version (void)
{
static gboolean beenhere = FALSE;
static guint version;
if (!beenhere)
{
if (getenv ("G_WIN32_PRETEND_WIN9X"))
version = 0x80000004;
else
version = GetVersion ();
beenhere = TRUE;
}
return version;
}

View File

@ -93,6 +93,11 @@ gchar* g_win32_get_package_installation_subdirectory (gchar *package,
gchar *dll_name,
gchar *subdir);
guint g_win32_get_windows_version (void);
#define G_WIN32_IS_NT_BASED() (g_win32_get_windows_version () < 0x80000000)
#define G_WIN32_HAVE_WIDECHAR_API() (G_WIN32_IS_NT_BASED ())
G_END_DECLS
#endif /* G_PLATFORM_WIN32 */