diff options
Diffstat (limited to 'src/config.hh')
-rw-r--r-- | src/config.hh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/config.hh b/src/config.hh new file mode 100644 index 0000000..efe7e4b --- /dev/null +++ b/src/config.hh @@ -0,0 +1,33 @@ +// config.hh -- compile-time configuration for AHFinderDirect +// $Id$ + +#ifdef CCTK_VARIABLE_REAL + // CCTK_REAL is defined + typedef CCTK_REAL fp; +#else + // we must be doing a test compilation outside of Cactus + // FIXME: this is just a hack until my Cactus problem report #725 + // is acted on and Cactus defines these + #define CCTK_REAL_CTYPE_FLOAT 4 + #define CCTK_REAL_CTYPE_DOUBLE 8 + #define CCTK_REAL_CTYPE_LONG_DOUBLE 16 + + typedef double fp; + #define CCTK_REAL_CTYPE CCTK_REAL_CTYPE_DOUBLE +#endif + +// scanf(3) formats for reading fp values +#if (CCTK_REAL_CTYPE == CCTK_REAL_CTYPE_FLOAT) + #define FP_SCANF_FORMAT "%f" +#elif (CCTK_REAL_CTYPE == CCTK_REAL_CTYPE_DOUBLE) + #define FP_SCANF_FORMAT "%lf" +#else + #error "don't know scanf(3) format for this CCTK_REAL!" +#endif + +// FIXME: another hack +#ifdef FINITE_DIFF_ORDER + // someone (probably a Makefile) has already defined this ==> leave it alone +#else + #define FINITE_DIFF_ORDER 4 +#endif |