pgicc needs offsetof
authorGengbin Zheng <gzheng@illinois.edu>
Wed, 22 Apr 2009 20:42:39 +0000 (20:42 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Wed, 22 Apr 2009 20:42:39 +0000 (20:42 +0000)
examples/fem/crack2D/crack.h
examples/fem/crack2D/fem_main.C

index ef7aa607611c6d08b9b1bfe3c420d6f4a76c9ab2..736a9f8c7dced0540eeb73def372a366d2a3ca20 100644 (file)
@@ -6,6 +6,11 @@
 #include <math.h>
 #include "fem.h"
 
+#if CMK_CC_PGCC
+#undef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
 //Coord describes a property with X and Y components
 struct Coord
 {
index 11db43e0a8f7fc7f2395decdc12c1a5803b4b542..f73d255e146e3c28509e023a224a2e9d8a818329 100644 (file)
@@ -2,9 +2,9 @@
  * Main implementation file for FEM version of crack propagation code.
  */
 #include <stddef.h>
+#include "charm++.h" // for CkWallTimer, CkPrintf, etc.
 #include "crack.h"
 #include "netfem.h"
-#include "charm++.h" // for CkWallTimer, CkPrintf, etc.
 
 void crack_abort(const char *why)
 {