aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/defs.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2009-09-21 11:33:11 -0500
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 16:45:09 +0000
commit0e7806cba5f78ac0b19bb93df919e84e95c1465b (patch)
treefa57cb9f561c1aca514175f49222e394c62a6b24 /Carpet/CarpetLib/src/defs.hh
parentac982406eb912fae3838d1cd0c012676134ee1d6 (diff)
CarpetLib: Provide offsetof macro in C++
Ignore-this: 61f2463f98afdefa755881082782b627
Diffstat (limited to 'Carpet/CarpetLib/src/defs.hh')
-rw-r--r--Carpet/CarpetLib/src/defs.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/defs.hh b/Carpet/CarpetLib/src/defs.hh
index 3a1188d21..9c42e2bdc 100644
--- a/Carpet/CarpetLib/src/defs.hh
+++ b/Carpet/CarpetLib/src/defs.hh
@@ -39,6 +39,14 @@ using namespace std;
+// Structure member offsets
+#undef offsetof
+#define offsetof(TYPE,MEMBER) ((size_t)&((TYPE*)0)->MEMBER)
+#undef __offsetof__
+#define __offsetof__ offsetof
+
+
+
// Number of dimensions
#ifndef CARPET_DIM
# define CARPET_DIM 3