mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 02:16:17 +01:00
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
This commit is contained in:
parent
b5258d9d76
commit
92e3189613
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user