Author: dgorbachev
Date: Wed May 27 14:55:41 2009
New Revision: 41138
URL:
http://svn.reactos.org/svn/reactos?rev=41138&view=rev
Log:
Fix warnings that are issued by new GCC versions.
Modified:
trunk/reactos/include/ddk/ntdef.h
trunk/reactos/include/host/typedefs.h
trunk/reactos/include/psdk/winnt.h
Modified: trunk/reactos/include/ddk/ntdef.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntdef.h?rev=41…
==============================================================================
--- trunk/reactos/include/ddk/ntdef.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/ntdef.h [iso-8859-1] Wed May 27 14:55:41 2009
@@ -156,8 +156,12 @@
// Returns the byte offset of the specified structure's member
//
#ifndef FIELD_OFFSET
+#ifndef __GNUC__
#define FIELD_OFFSET(Type, Field) \
((LONG)(LONG_PTR) (&(((Type *) 0)->Field)))
+#else
+#define FIELD_OFFSET(Type, Field) __builtin_offsetof(Type, Field)
+#endif
#endif
//
Modified: trunk/reactos/include/host/typedefs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/host/typedefs.h?re…
==============================================================================
--- trunk/reactos/include/host/typedefs.h [iso-8859-1] (original)
+++ trunk/reactos/include/host/typedefs.h [iso-8859-1] Wed May 27 14:55:41 2009
@@ -218,7 +218,11 @@
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
#define NT_SUCCESS(x) ((x)>=0)
+#if !defined(__GNUC__)
#define FIELD_OFFSET(t,f) ((LONG_PTR)&(((t*)0)->f))
+#else
+#define FIELD_OFFSET(t,f) __builtin_offsetof(t,f)
+#endif
#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
#define CONTAINING_RECORD(address, type, field) ((type *)(((ULONG_PTR)address) -
(ULONG_PTR)(&(((type *)0)->field))))
Modified: trunk/reactos/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=4…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Wed May 27 14:55:41 2009
@@ -1280,7 +1280,11 @@
#define RTL_CRITSECT_TYPE 0
#define RTL_RESOURCE_TYPE 1
/* Also in winddk.h */
+#ifndef __GNUC__
#define FIELD_OFFSET(t,f) ((LONG_PTR)&(((t*)0)->f))
+#else
+#define FIELD_OFFSET(t,f) __builtin_offsetof(t,f)
+#endif
#ifndef CONTAINING_RECORD
#define CONTAINING_RECORD(address, type, field) \
((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))