Add definition of _FOFF_DYNAMIC(c,f) as an alternative to _FOFF(c,f) where f cannot be computed at compile time GCC_SURGE
authorWilliam Roberts <williamr@symbian.org>
Fri, 11 Jun 2010 17:54:34 +0100
branchGCC_SURGE
changeset 143 de794338254b
parent 142 32128eb83e75
child 144 c5e01f2a4bfd
Add definition of _FOFF_DYNAMIC(c,f) as an alternative to _FOFF(c,f) where f cannot be computed at compile time
kernel/eka/include/e32def.h
--- a/kernel/eka/include/e32def.h	Fri Jun 11 16:28:18 2010 +0100
+++ b/kernel/eka/include/e32def.h	Fri Jun 11 17:54:34 2010 +0100
@@ -443,8 +443,9 @@
 @see TDblQue
 */
 #ifndef _FOFF
+#define _FOFF_DYNAMIC(c,f)	(((TInt)&(((c *)0x1000)->f))-0x1000)		// can be a runtime calculation if f is not sufficiently constant
 #if __GNUC__ < 4
-#define _FOFF(c,f)			(((TInt)&(((c *)0x1000)->f))-0x1000)
+#define _FOFF(c,f)			_FOFF_DYNAMIC(c,f)
 #else
 #define _FOFF(c,f)			(__builtin_offsetof(c,f))
 #endif