summaryrefslogtreecommitdiff
path: root/src/include/cctk_Types.h
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2005-12-13 15:12:34 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2005-12-13 15:12:34 +0000
commit60a9d3ed2ebfc4bec092911124000715983147fe (patch)
tree1ab19d19b53e8969dc9045bbe29972302733228c /src/include/cctk_Types.h
parente278fca42170c3578019315a5b348f5e9e755ac0 (diff)
Define macros CCTK_{INT,REAL,COMPLEX}_PRECISION to values of 1, 2, 4, 8, 16,
or 32, depending on the definition of the default data types CCTK_{INT,REAL,COMPLEX}. These new macros make type generic code more convenient to write. Patch from Erik Schnetter. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4209 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/include/cctk_Types.h')
-rw-r--r--src/include/cctk_Types.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/cctk_Types.h b/src/include/cctk_Types.h
index 8405b3f3..d15dba0c 100644
--- a/src/include/cctk_Types.h
+++ b/src/include/cctk_Types.h
@@ -118,45 +118,55 @@ typedef unsigned char CCTK_BYTE;
/* Floating point precision */
#ifdef CCTK_REAL_PRECISION_16
+#define CCTK_REAL_PRECISION 16
#define CCTK_REAL CCTK_REAL16
#endif
#ifdef CCTK_REAL_PRECISION_8
+#define CCTK_REAL_PRECISION 8
#define CCTK_REAL CCTK_REAL8
#endif
#ifdef CCTK_REAL_PRECISION_4
+#define CCTK_REAL_PRECISION 4
#define CCTK_REAL CCTK_REAL4
#endif
/* Integer precision */
#ifdef CCTK_INTEGER_PRECISION_8
+#define CCTK_INTEGER_PRECISION 8
#define CCTK_INT CCTK_INT8
#endif
#ifdef CCTK_INTEGER_PRECISION_4
+#define CCTK_INTEGER_PRECISION 4
#define CCTK_INT CCTK_INT4
#endif
#ifdef CCTK_INTEGER_PRECISION_2
+#define CCTK_INTEGER_PRECISION 2
#define CCTK_INT CCTK_INT2
#endif
#ifdef CCTK_INTEGER_PRECISION_1
+#define CCTK_INTEGER_PRECISION 1
#define CCTK_INT CCTK_INT1
#endif
/* Complex precision */
#ifdef CCTK_REAL_PRECISION_16
+#define CCTK_COMPLEX_PRECISION 32
#define CCTK_COMPLEX CCTK_COMPLEX32
#endif
#ifdef CCTK_REAL_PRECISION_8
+#define CCTK_COMPLEX_PRECISION 16
#define CCTK_COMPLEX CCTK_COMPLEX16
#endif
#ifdef CCTK_REAL_PRECISION_4
+#define CCTK_COMPLEX_PRECISION 8
#define CCTK_COMPLEX CCTK_COMPLEX8
#endif