[glib/glib-2-48] gmacros.h: offsetof is also available on MSVC
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-48] gmacros.h: offsetof is also available on MSVC
- Date: Wed, 17 Aug 2016 21:39:57 +0000 (UTC)
commit b0508b4c7bc31cadb09183255947b849cb48f6ae
Author: Nirbheek Chauhan <nirbheek centricular com>
Date: Mon Jul 11 18:17:34 2016 +0530
gmacros.h: offsetof is also available on MSVC
All versions since Visual C++ 2005 have this available, so we can just
use it for G_STRUCT_OFFSET.
See: https://msdn.microsoft.com/en-us/library/dz4y9b9a.aspx
glib/gmacros.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/glib/gmacros.h b/glib/gmacros.h
index 9113221..7583479 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -311,7 +311,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]