pgi compiler needs offsetof
authorGengbin Zheng <gzheng@illinois.edu>
Wed, 22 Apr 2009 20:41:33 +0000 (20:41 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Wed, 22 Apr 2009 20:41:33 +0000 (20:41 +0000)
examples/fem/matrix/pgm.C

index 1282f69021fd45f2afd15e93b936e79dacee1eb0..3af8c53a5e201fd345b051204be1192da398c84c 100644 (file)
@@ -12,6 +12,11 @@ Orion Sky Lawlor, olawlor@acm.org, 1/27/2003
 #include "netfem.h"
 #include "ifemc.h"
 
+#if CMK_CC_PGCC
+#undef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
 //Number of time steps to simulate
 int tsteps=10;
 int dim=10;//Elements per side of the FEM mesh