diff --git a/glib/glib/gmacros.h b/glib/glib/gmacros.h index f3f542b..a4def7a 100644 --- a/glib/glib/gmacros.h +++ b/glib/glib/gmacros.h @@ -260,7 +260,7 @@ * fields through their offsets. */ -#if defined(__GNUC__) && __GNUC__ >= 4 +#if (defined(__GNUC__) && __GNUC__ >= 4) || defined (_MSC_VER) # define G_STRUCT_OFFSET(struct_type, member) \ ((glong) offsetof (struct_type, member)) #else diff --git a/glib/glib/gthread-win32.c b/glib/glib/gthread-win32.c index c54f2bd..e3b0c12 100644 --- a/glib/glib/gthread-win32.c +++ b/glib/glib/gthread-win32.c @@ -337,12 +337,12 @@ static CRITICAL_SECTION g_private_lock; static DWORD g_private_get_impl (GPrivate *key) { - DWORD impl = (DWORD) key->p; + DWORD impl = (DWORD) GPOINTER_TO_UINT(key->p); if G_UNLIKELY (impl == 0) { EnterCriticalSection (&g_private_lock); - impl = (DWORD) key->p; + impl = (UINT_PTR) key->p; if (impl == 0) { GPrivateDestructor *destructor;